Erection difficulty

Michael

My girlfriend and I usually have sex often typically without issue however every once in a while I struggle to maintain an erection and I have no idea why this is. I'm always turned on by her and this issue cause her to think it's her eventhough it isn't at all. What's wrong with me?