Very little in life is either all good or all bad. The same genes that help protect us from some ailments might make us susceptible to others. Shouting obscenities can alleviate pain. And researchers, who published their findings in the journal Pediatrics, say frowned-upon behaviors like thumb-sucking and nail-biting might actually reduce kids’ risks of developing allergies later in life.

The idea that putting your germ-covered hands in your mouth might be beneficial will come as no surprise to those familiar with the hygiene hypothesis. The theory is that, in this age of hand sanitizer and antibiotics, the absence of germs and other immune-triggering substances in the environment weakens our immune systems and makes them more sensitive. In turn, that sensitivity may be responsible for the modern increase in allergies and autoimmune diseases.

Earlier studies have shown that exposing small children to small amounts of immune triggers from pet dander to germy pacifiers can protect them later in life. It’s been suggested that even booger-eating could pay off in the long run. ("I've got two beautiful daughters and they spend an amazing amount of time with their fingers up their nose," University of Saskatchewan biologist Scott Napper told the CBC in 2013, when he floated the idea of a study about the subject to his students. "And without fail, it goes right into their mouth afterwards. Could they just be fulfilling what we're truly meant to do?”) So imagining a silver lining for other scold-worthy habits was kind of a logical next step.

To find their nail-biters and thumb-suckers, researchers tapped into the Dunedin Multidisciplinary Health and Development Study, which followed more than 1000 residents of Dunedin, New Zealand, from birth to age 38. When the study subjects were 5, 7, 9, and 11 years old, scientists asked their parents about the kids’ thumb-sucking and nail-biting behaviors. When they were 13, the scientists gave them their first skin-prick test, monitoring the kids’ immune responses to tiny doses of 11 different allergens (not including foods or hay fever triggers). At 32, the participants were tested again.

Those pesky habits were unsurprisingly common. From ages 5 to 11, 31 percent (317 kids) regularly sucked their thumbs or bit their nails. Allergies were pretty common, too; at 13, around 45 percent of all the kids displayed some sort of allergic response to the scratch tests. But that number represents an average of all the kids, regardless of behaviors or habits. Splitting the group tells a different story. Kids that didn’t engage in thumb-sucking or nail-biting had a 49 percent chance of developing allergies. Kids that sucked their thumbs or bit their nails had a 40 percent risk. But kids that did both had the lowest allergy risk of all, at 31 percent—an 18 percent reduction.

The patterns held strong into adulthood, even when the researchers controlled for household exposure to smoke, pets, dust mites, and other triggers.

Of course, that doesn’t mean that we should all follow their example. Both thumb-sucking and nail-biting can lead to dental problems and skin infections, after all. Malcolm Sears of McMaster University assisted with the study. "While we don't recommend that these habits should be encouraged, there does appear to be a positive side to these habits," he said in a press statement.

Know of something you think we should cover? Email us at tips@mentalfloss.com