Your coffee might sabotage your sleep well after you stop sipping it: Caffeine can change your circadian clock, a process in your body responsible for sleep-wake timing, a new study from the University of Colorado at Boulder suggests.

In the study, people who popped a caffeine supplement—roughly the equivalent of a double espresso—three hours before their normal bedtime experienced a 40-minute delay in their circadian clocks. And that delay would make it harder to fall asleep at your normal time, as well as make you want to sleep in later than usual the following morning, too.

Now, it’s not exactly groundbreaking that coffee makes you more alert. Caffeine binds to certain receptors in your body, which blocks the effects of a sleep-promoting neurotransmitter called adenosine.

But here’s why the study’s findings are interesting: It discovered that this binding increases the levels of a chemical in your body’s cells called cyclic AMP, which is one of the “gears” that allows your cells to keep time. As a result, it actually lengthens your cell’s circadian clocks, says study author Kenneth Wright, Ph.D.

And you don’t have to be a regular coffee drinker for this change to occur. Your circadian clocks are screwed after just one dose of caffeine. 

Related: 7 Ways to Boost Energy without Caffeine
 
So if you need to stick to a certain bedtime and wake time—like most guys in the working world do—the best course of action is to avoid caffeine in the evenings. And you might want to cut yourself off even earlier than the three-hour benchmark used in the study, Wright recommends. That’s because previous research has found that caffeine six hours before bed can disrupt sleep, too.

You’ll also want to start dimming the lights before sleep, he says. According to the study, people who took caffeine and were exposed to super-bright lights three hours before bedtime delayed their circadian clocks by 105 minutes.