If cookies, chips, and other high-calorie snacks take longer to fall from the vending machine, you may be enticed to get a healthier snack instead, according to a new study funded by the National Institutes of Health.

The researchers created experimental vending machines that had a 25-second time delay before high-calorie snack options were released. Consumers were made aware of the delay by signs on the machines and a touchscreen menu with a countdown timer.

Read: Hacked Vending Machine Publicly Tweets What You Buy, Shames You Into Eating Healthier​

“Having to wait for something makes it less desirable,” Brad Appelhans, lead investigator of the study, said in a press release. “Research shows that humans strongly prefer immediate gratification, and this preference influences choices and behavior in daily life.”

The delay made some people rethink their snack choices. There was a 2-5 percent increase in the proportion of total healthy snack purchases.

Items defined as “healthy,” had to meet at least 5 of the 7 criteria, including less than 250 calories per serving, 35 percent or fewer calories from fat, less than 350 milligrams of sodium per serving, no trans fat, less than 5 percent of daily value of saturated fat per serving, more than 1 gram of dietary fiber per serving, and less than 10 grams of added sugar per serving.

The authors hope this vending machine system will offer an effective way to persuade individuals’ to make healthier choices.

One psychologist, not involved in the study, notes this type of machine may have some negative effects, NPR reports.

“There is a risk that people would get upset with the delay because people know it’s just to influence their behavior. Some might complain,” Marlene Schwartz told NPR. Despite this, she is still excited by the idea and describes it as “brilliant.”

See also: Vending Machine Bans In Schools Encourage Kids To Find Fast Food Elsewhere; Changing Diets Requires Large-Scale Change​

Space-Age Vending Machine, Luce X2 Touch TV, Uses Facial Recognition To Deny And Dispense Snacks​