A study led by a University of Colorado Boulder researcher involving more than 1,800 twins has concluded that those who smoke a lot of marijuana as teenagers will be more likely to have trouble falling or staying asleep when reaching adulthood.

The study, published in the journal Sleep, comes at a time when cannabis in its many forms is increasingly being marketed as a sleep aid in states where pot is legal. It adds to a growing body of evidence suggesting that while it may help some users fall asleep occasionally, chronic use can have negative long-term consequences, particularly in the young, according to a news release.

“People tend to think that cannabis helps with sleep, but if you look closely at the studies, continued or excessive use is also associated with a lot of sleep deficits,” lead author Evan Winiger, a graduate student in the Institute for Behavioral Genetics, said in a statement.

For the study, Winiger analyzed data from 1,882 young adults from the Colorado Twin Registry, which has been following twins for research since 1968. Each had completed surveys about their sleep habits, marijuana use and mental health. It was found that about one-third of those who started using weed regularly before age 18 had insomnia as adults, compared to less than 20% among those who didn’t consume cannabis regularly as teens