A Massachusetts man has died after eating an excessive amount of black licorice, doctors said this week.

The unusual case was reported in the New England Journal of Medicine and details the death of a 54-year-old construction worker. The man collapsed inside a fast-food restaurant and was taken to a hospital, where he died the next day. Doctors discovered he had dangerously low potassium, which led to heart rhythm and other problems.

Doctors wrote that the man had maintained “a poor diet, consisting primarily of several packages of candy daily,” which threw his nutrients out of whack. One doctor cited in the study described the man’s diagnosis as, “Metabolic, renal, vascular, and cardiac toxic effects from apparent mineralocorticoid excess due to licorice consumption.”

The problem, according to a report from the Associated Press, lies in the consumption of glycyrrhizic acid, a sweetening compound found in black licorice and in other foods containing licorice root extract. It can deplete potassium levels, cause high blood pressure, and imbalance electrolytes.

“The key message here for the general public is that food containing licorice can potentially be hazardous to your health if eaten in large quantities,” said Dr Neel Butala, a cardiologist at Massachusetts General Hospital, who contributed to the case study. “I don’t think people realize it. It’s not labeled that way.”

In 2017, the U.S. Food and Drug Administration published a warning about the dangers of black licorice consumption, advising that eating only two ounces of black licorice a day for two weeks could lead to an irregular heart rhythm and may require hospitalization.

With Halloween coming up next month, perhaps this new study will serve as a reminder to enjoy candy in moderation.