Before going to sleep, some people feel a sudden need to drink a glass of water. A new study of mice uncovers “anticipatory thirst”: craving a drink before sleeping in order not to wake up feeling dehydrated.

Led by lead author and Ph.D. student Claire Gizowski, researchers from the Research Institute of the McGill University Health Centre (RI-MUHC) conducted tests on mice to discover why they suddenly drink large amounts of water before sleeping, even if they weren’t dehydrated at the time. According to a news release, when the team cut off the mice from water, the mice became dehydrated just before they awoke from their slumber. The water they drank before sleep kept them hydrated through the night.

"Although this study was performed in rodents, it points toward an explanation as to why we often experience thirst and ingest liquids such as water or milk before bedtime,” Charles Borque, the study’s senior author, said in the news release. Knowing the mice needed to drink water before sleeping to prevent dehydration, the team wanted to learn what caused the mice to become thirsty in the first place.

The team believed the sudden cause of thirst may be caused by the suprachiasmatic nuclei (SCN), also known as the biological clock, and were able to confirm that with “sniffer cells” inserted into the rodents’ brain tissue. The cells were designed to glow in the presence of vasopressin, a neuropeptide created by SCN. "We saw a big increase in the output of the sniffer cells, indicating that vasopressin is being released in that area as a result of stimulating the clock,” Borque said.

Next, the researchers needed to link the vasopressin to the thirst neurons in the mice. Using a technique called optogenetics, the team were able to show the thirst neurons being turned on by vasopressin. Bourque, professor in MgGill’s department of neurology and scientist at the brain repair and integrative neuroscience program at the (RI-MUHC), said, “The findings could point the way toward drugs that target receptors implicated in problems that people experience from shift work or jet lag.”

Read more: How Much Sleep Do We Need To Stay Healthy?

Gizowski C, Zaelzer C, Bourque C. Clock-driven vasopressin neutransmission mediates anticipatory thirst prior to sleep. Nature. 2016