In today’s digital age, many of us are guilty of being glued to our devices at all hours of the day, including when it's time to get some rest. Using your smartphone or tablet before bedtime seems harmless, but it might be affecting how well you sleep, according to new research.

The results of a small study, published in the journal Ophthalmic & Physiological Optics, adds to an extensive body of research that highlights the negative effects artificial light has on sleep quality. Participants who wore short wavelength-blocking glasses several hours before they went to bed had nearly a 58 percent increase in the amount of melatonin their body produced at night. Melatonin is a natural hormone, produced by a tiny gland in your brain, that lets your body know when it’s time to sleep, according to the National Sleep Foundation.

In addition to the objective sleep measures, the researchers also collected subjective sleep quality data through the Pittsburgh Sleep Quality Index (PSQI). Results from the self-report questionnaire showed that study participants reported sleeping better, falling asleep faster, and sleeping longer each night.

Read: Fertility Problems: Why Artificial Light Harms Chance of Pregnancy For Middle-Aged Women

“The most important takeaway is that blue light at night time really does decrease sleep quality,” Dr. Lisa Ostrin, an assistant professor at the University of Houston College of Optometry, who lead the study, said in a statement. “Sleep is very important for the regeneration of many functions in our body.”

In the study, Ostrin and her colleagues monitored the activity and sleep patterns of 21 participants, ages 17-42 years old. Each individual was asked to put on short wavelength-blocking glasses three hours before they went to bed for two full weeks. During this time, they were assigned to engage in their usual nightly digital routine. The researchers collected data through several different methods: simulation to analyze pupil response; wearable actigraph devices to monitor activity, light exposure, and sleep; and saliva samples to assess melatonin levels.

Melatonin is suppressed when the body is exposed to artificial light, such as the blue light found in a majority of LED-based devices. This occurs because the artificial light activates photoreceptors, which prevent melatonin production. To combat the negative effect of blue light, Ostrin recommends using specific glasses that block the light.

Read: Sleep Disorder May Be Early Sign Of Parkinson’s Disease And Other Neurological Conditions

“By using blue blocking glasses we are decreasing input to the photoreceptors, so we can improve sleep and still continue to use our devices,” she said. “That’s nice, because we can still be productive at night.”

She also suggests using anti-reflective lenses, spending less time using screens, and applying screen filters to help block artificial light.

See also: Get Better Sleep: Infographic Shows Why You Can’t Make Up For Hours Of Missed Sleep

Tricking Your Mind Into Falling Asleep: Placebo Eases Insomnia Symptoms, Review Says