He got soft

I hooked up with my best friend and he was hard and then we started to fuck and he got soft. And then we just kept trying to get him hard and we fucked without a condom and im so scared but thats another issue. Anyways he didnt finish inside me and eventually i blew him and he came. But i dont understand what i did wrong. Why couldnt he stay hard?? Was it my fault??