Without filters for our beer and wine, we’d be drinking gritty sludge every time we cracked open a cold one or poured a glass of red with dinner.

Filtration is an essential step to brewing beverages like these, but it’s also one that scientists have discovered, is leaving behind some nasty particles of its own. Research had detected heavy metals like arsenic, lead and cadmium in these boozy beverages — and no one had any idea where they were coming from.

Until now.

In a study recently published in the Journal of Agricultural and Food Chemistry, scientists identified the source of these pesky particles. Benjamin Redan, Lauren Jackson and their colleagues suspected that the unwanted pieces of metal were coming from the very filters that were used to strain the beer or wine.

These filters are known as Diatomaceous Earth (DE) filters. And they are weird. If you just google search “Diatomaceous Earth” you’ll find a substance used as an insecticide. In its basic form, Diatomaceous Earth literally melts the exoskeletons off insects it comes into contact with. Making it extremely effective for purging your garden of unwanted guests and infestations.

But it also makes for a really effective filtration system for alcoholic beverages.

DE filtration uses those melted skeletons (of insects and small single celled organisms) to coat a filter element, and to act as the ‘filter media.” It basically works like a sponge, soaking up any and all sedimentary particles as the beer or wine passes through.

However, those filters are also the source of the troublesome heavy metals that scientists were finding in our beer and wine.

The team tested three types of food-grade DE and found that all of them contained arsenic as well as smaller amounts of lead and cadmium,” the Eureka Alert press release on the study, reads.

All three of which are poisonous in high enough dosages. Arsenic poisoning can result in red and irritated skin, nausea and vomiting, abdominal pain, muscle cramps and tingling of the fingers and toes. Ingestion of cadmium causes immediate liver and kidney damage. And lead poisoning can cause learning delays, developmental disorders, seizures, and even loss of hearing.

Luckily for us, the FDA closely monitors the levels of these heavy metals in any drink being sold publicly on the market. So you don’t have to worry about getting lead poisoning from smashing a sixer of your favorite brew.

However, your buddy’s homebrewed IPA or home-vinified red wine might be a different story…

Hope is not lost, though. The scientists note at the end of their study that simple steps can be taken to mitigate this issue. It’s just going to take a little scientific ingenuity to filter out the filters so our beverages are pure, and heavy-metal free.