The Food and Drug Administration allowed the maker of a faulty implantable heart device to secretly log 50,000 malfunction incidents, according to a series of investigations by Kaiser Health News.

The device—the Sprint Fidelis, made by Medtronic—consists of a pair of wires and a defibrillator to jolt the heart into a regular rhythm. But doctors found that it was giving patients random, harmful zaps and sometimes failed during actual cardiac emergencies.

Medtronic recalled the device in 2007 but only after it was implanted in around 268,000 patients. Many of those patients have since faced the ghastly choice of learning to live with the faulty device or undergoing an invasive, risky—sometimes deadly—surgery to remove it. According to the KHN investigation, they’ve been making that choice without information from the 50,000 incident reports.

Malfunction reports for devices like the Spring Fidelis are typically recorded in a public-facing FDA database called MAUDE (Manufacturer and User Facility Device Experience). However, the agency quietly set up an “alternative summary reporting” repository and for decades granted reporting exemptions for a wide variety of medical devices. The agency has since piled up millions of incident reports out of public view. That includes the 50,000 reports for the Sprint Fidelis. Since 2016, the FDA’s repository accrued at least 1.1 million reports of incidents and injuries overall from malfunctioning medical devices, KHN found.

The alternative reporting repository was ostensibly set up to cut down on paperwork for redundant incident reports. But its existence and use has been kept in the shadows, with many doctors, consumer advocates, and even some high-ranking employees at the FDA kept completely unaware of its existence. Now that they are aware, doctors and advocates say the concealed reports have kept necessary safety data from patients trying to accurately gauge and weigh their risks.

“It’s not in the best interest of the patients who have these devices,” Dr. Robert Hauser told KHN. Hauser, a Minnesota cardiologist, was one of the first to raise concerns about the Sprint Fidelis. After learning that the FDA had granted Medtronic a MAUDE-reporting exemption for the Sprint Fidelis, Hauser responded: “Amazing. Really amazing.”

The list of exempted devices includes common and controversial devices. Some of these are typically implanted into patients and used in common surgeries, such as pelvic mesh, surgical staples, balloon pumps for improving circulation, breathing machines, and breast implants.

Following KHN’s investigation, the FDA announced that it will be shutting down the “alternative summary reporting” repository and ending exemptions. Former FDA official Dr. S. Lori Brown told KHN that the move is a “victory for patients and consumers.”