period starts back

Well, the day my period ends I always masturdate. I'm not sure why but I get the urge to. I don't finger mysekf I just rub my clit until orgasm. Well every time I orgasm after my period, my period starts back. Is it because I masturbate within hours of my period ending ? Or what?