I have a question

Why does it feel like I have the worst period cramps during sex.. But only sometimes.. In certain positions.. It's not everytime we do doggy but sometimes I have to just stop having sex cuz it hurts so bad. And today everything was totally fine until we tried reverse cowgirl but as soon as we did I almost screamed. (Not in the fun way)