There may be something a little scarier than tricks, treats, ghouls and goblins on the prowl this Halloween — apples unintentionally infected with bacteria.

Unrefrigerated caramel apples with dipping sticks can become a fertile breeding ground for the bacterium Listeria monocytogenes, better known as Listeria, according to a study from the University of Wisconsin-Madison’s Food Research Institute.

Listeriosis is a serious infection that is typically caused by ingesting food contaminated with L. monocytogenes. Its symptoms include fever and muscle aches.

If you buy caramel apples at your local grocery, it’s best to look for those that are refrigerated versus those that may have been sitting out on store shelves.

The study was prompted by a 2014 listeriosis outbreak that showed that 90% of individuals who got ill had reported consuming pre-packaged and commercially-produced caramel apples.

To try to figure out what had caused the outbreak, researchers swabbed the stem, the skin, and the bottom of apples with four different L. monocytogenes strains before inserting sticks in half of the apples. Then they stored groups of apples with and without sticks at room temperature or in the refrigerator.

Both the presence of dipping sticks and the manner in which the apples were stored affected bacterial growth.

When you push a stick into an apple’s skin, small amounts of liquid come to the surface and this can accelerate the growth of bacteria, Kathleen Glass, the study’s lead coauthor, explained. The temperature at which the apples are stored is also important.

Growth of Listeria was higher for those apples that had been punctured with dipping sticks and left at room temperature. Bacterial growth was delayed for both refrigerated apples with sticks, and for those without sticks stored at room temperature. And there was no growth observed in refrigerated apples without sticks.

If you are a planning a party and want to prepare caramel apples for your guests, Glass recommends thoroughly cleaning the apples beforehand and preparing and eating them fresh. A second safety measure would be to store all uneaten caramel apples in the fridge. Discard them after a week.

If you buy caramel apples at your local grocery, it’s best to look for those that are refrigerated versus those that may have been sitting out on store shelves. For commercial producers of caramel apples, these recommendations still apply, with the added instruction to use caramel coatings or apple wax that have added growth inhibitors.

The study is published in mBio.