You’ve probably experienced your period coming a little late, a little early, or otherwise acting wonky during a particularly stressful month. It’s no big deal, right? Except that the stress of having an unpredictable menstrual cycle can add to the other stress in your life, causing a feedback loop that’s ultimately not good for your body or your mind. Here’s why and how stress affects your cycle — and what you can do to fix it.

Becca Sarich, CNM, a certified nurse midwife and holistic pelvic care practitioner explains the powerful influence of stress on the body: “The menstrual cycle is regulated by a hormonal feedback loop that is intimately involved with our brain. Stress activates a pathway within the hypothalamic pituitary axis. When we experience stress, the body releases two hormones, cortisol and corticotrophin-releasing hormone (CRH) to help regulate the stress response. When these hormones are in excessive amounts, they impact our sex hormones, thereby interfering with the delicate balance that is involved in regulating our menstrual cycles. I think of it like an orchestra. If one instrument is playing a different tune, the entire balance of the sound is thrown off.”

When that hormonal balance is disturbed, it can manifest in your cycle in different ways, including late or missed periods, delayed ovulation, and even in more painful cramps. One large study of Chinese women found that having a stressful month can cause more dysmenorrhea — more commonly referred to as painful periods — in the subsequent cycle. Another study shows that incarcerated women have high rates of amenorrhea (absence of a period) and menstrual irregularity, likely linked to the stresses of their lives before and during incarceration.

But it’s not just the stress in your life that can affect your cycle, where you are in your menstrual cycle can actually influence how you respond to stress. A 2017 study in the journal Physiology and Behavior looked at currently menstruating and post-menopausal people and found that during the second half of your cycle (the luteal phase), there is a more intense stress response to social stress than when during the first half of the cycle (follicular phase). The same study also found that post-menopausal women have a lower stress response to social stressors than women who are currently cycling.

So, how do you know if stress is messing with your cycle — or if your killer cramps, delayed periods, or other symptoms are linked to something else? Sarich says, “It can be difficult to determine the origin of irregularities, so I always recommend seeking out a trusted women’s healthcare provider to help you determine the cause. When I counsel women, I ask them about the stress they are experiencing now, and in the preceding few months. It is usually when the stress gets to a higher threshold than what they are used to that I see it impact their cycles.”

Of course, we all have some level of stress in our lives. It’s impossible not to, especially in situations outside of our individual control, like work problems or family issues, but you can take some actions, both before and during your period, to improve your body’s stress response. One of Sarich’s main suggestions? Get good sleep: “We are a culture of chronically sleep deprived people. The hormones of the pituitary gland, which regulate our hormonal cycles, can be impacted by lack of sleep, as well as artificial light (meaning light from your home, devices, and outside). Sleeping in total darkness, if you can, can help regulate the menstrual cycle, and especially ovulation.”

Even if you can’t force yourself to get more zzzs, there are still plenty of ways you can lessen stress in order to keep a healthy cycle, says Sarich. “When you are in periods of high stress, look to things that positively impact your mindset, like yoga and exercise. Avoiding excessive caffeine and getting more whole foods into your diet can also positively impact the stress response in the body.” Practice good self-care, as well, whatever that may mean to you and in your life — from more pricey activities like massage to simple time spent with friends — can help your body cope with both physical and mental stresses.

Carrie Murphy is a freelance writer and doula in Albuquerque, NM. Read more on her website, carrie-murphy.com.