Researchers have now shown that there is such a thing as a “night munchies” mutated gene that leads to a grating need for a midnight snack before bed.

This is the first time that the gene, known as PER1, has been linked to night eating syndrome (NES). NES involves a constant feeling of hunger at night, which can lead to overeating and weight gain. Research has linked it to more serious mental disorders as well as eating disorders; people who suffer from NES consume most of their caloric intake after 6 p.m. These individuals often feel as though they lack control over what and when they eat, then proceed to feel guilty after their binge. The National Institutes of Mental Health (NIMH) notes that NES affects about one to two percent of the U.S. population, both men and women.

In the study, researchers tested mice with the human genes of PER1 and PER2, which had previously been associated with sleep problems. When the researchers deactivated PER1, the eating behaviors of the mice became disrupted; they were prone to start eating instead of sleeping. The mice with the faulty PER1 gene gained weight due to these eating habits, until the researchers began monitoring their meals and feeding them only during the day, which led them to maintain normal weights. This shows that the weight gain was directly related to the night eating.

“For a long time, people discounted night eating syndrome as not real,” Dr. Satchidananda Panda of the Salk Institute in La Jolla, California, said in a press release. “These results in mice suggest that it could actually be a genetic basis for the syndrome. We really never expected that we would be able to decouple the sleep-wake cycle and the eating cycle, especially with a simple mutation. It opens up a whole lot of future questions about how these cycles are regulated.” The researchers have yet to test whether humans with NES have any PER1 mutations.

When the gene is mutated, sleep and eating cycles are thrown off, which could potentially make it much easier for people to crave calories before bed. Sufferers of NES typically don’t eat much in the morning or during the day, proceed to overeat at night, and then rely on food when they wake up during the night in order to fall back asleep.

If you’re battling NES, try starting a journal to monitor your sleep and eating schedule, and to bring yourself back on track. Sleep hygiene and exercise are both essential to maintaining eating schedules, and abstaining from drinking can also help curb tendencies to over-eat at night. For those whom NES is severe and who may suffer from other eating disorders, therapy is always an option.