Cramping after masturbation

So I’m currently on my period. However, every time I masturbate i get super bad cramps in my vagina. They’re pretty strong too. Is there any reason why this happens? Maybe a way to stop it from happening?