If you can’t seem to eat right, consider getting a good night’s sleep. This simple achievement has been linked to the ability to make better food choices, according to a study published in the American Journal of Public Health and reported by MedicineNet.

For the study, Harvard Medical School researchers examined 542 male motor freight workers, who often work long and irregular hours. Researchers discovered they were less prone to eating unhealthy foods if they got adequate sleep.

“Adequate sleep is a significant predictor of the dietary patterns of male motor freight workers and mediates the effects of the workplace on healthful food choices,” said Orfeu Buxton, PhD, the study’s lead author. “If a motor freight worker receives adequate sleep, he is more likely to make healthful food choices than one who does not receive enough sleep, regardless of his workplace environment.”

But for those of us who aren’t motor freight workers, the study’s findings are also compelling.

“Sleep duration and sleep quality are contributing factors to increasing chronic disease trends, in that insufficient sleep duration and sleep disruption have been linked to weight gain, diabetes and early mortality in the long term,” study authors concluded.

Did you know sleep loss might hinder diabetes control? Read about it here.