Sex File: He says he's attracted to me but he keeps losing his erection

We have a great time together, lots of sexual chemistry, but as soon as we get going he loses his erection.
He says he’s very attracted to me and that it’s only happened once or twice before. What could be the cause?