In the study, 98 female participants were split into two groups, one of which was tasked with writing about a time in their lives when they felt in control while the other wrote about a moment when they felt out of control. The groups were then placed in a quiet, tidy kitchen or a chaotic, messy one, covered in dirty dishes, old newspapers and a ringing phone. Finally, they were given cookies, crackers, and carrots to taste and rate.

Within 10 minutes, the women who had recalled a time when they felt out of control and were situated in the dirty kitchen ate 53 more calories from cookies than the similarly stressed out women who were chilling in the clean kitchen.

They also ended up consuming more cookies (103 kcal) than those who entered the messy room after recounting a moment that they were in control (38 kcal).

“Although a chaotic environment can create a vulnerability to making unhealthy food choices, one’s mindset in that environment can either trigger or buffer against that vulnerability,” the researchers state.

So aside from cleaning up your space, changing your mindset can help you stop reaching for the snacks when you’re stressing out.

“Being in a chaotic environment and feeling out of control is bad for diets,” lead author of the study, Lenny Vartanian, said in a statement. “It seems to lead people to think, ‘Everything else is out of control, so why shouldn’t I be?’”