Going flaccid during sex

Lately my boyfriend has been having trouble keeping it hard. He doesn't know why, he says he feels normal. Yet the past 3 times we've had sex he'll get soft in the middle of it. Hasn't happened before so I'm worried. 
Has this happened to anybody? 
What do you think is causing this