The taser may soon become safer—a team of researchers from the Wake Forest University School of Medicine has equipped a prototype device with a heart monitor so that police can stop tasing before a suspect’s life is in danger, according to a study published Tuesday in the Journal of Forensic and Legal Medicine.

For the 16,000 police officers in 107 countries, tasers or stun guns are a non-lethal way to pacify a suspect that is resisting arrest or putting the officers at risk. But as law enforcement has increased the frequency with which they deploy tasers—it’s now an estimated 328,000 times worldwide every year—the non-lethal technique has become deadly in some instances. Sometimes, the stun gun served to incapacitate a suspect before further harm was done—in 2015, a policeman shot Walter Scott, who was fleeing a traffic stop, first with a taser and then a gun.

In other cases, it was the taser itself that killed a suspect.

Tasers incapacitate people by sending a low-current, high-voltage electrical shock through their body, causing the muscles to contract painfully. Normally this contraction is limited to the muscles that keep the body moving and upright. But on occasion, it’s affected the heart, causing a condition called cardiac defibrillation, which interrupts the heart’s normal beating and causes it to beat wildly and without rhythm. There have been several deaths from this, mostly in people who had preexisting heart conditions like a pacemaker, but it’s enough that it’s caused experts to question whether tasers are really safe, after all.

In an effort to make a safer taser, the researchers behind this study figured that, if officers could see a reading of a suspect’s heart beat once the taser has been deployed, they could stop using it before the suspect’s life was in danger, or alert EMTs after the taser was used if the heart beat seems off.

The researchers first outfitted a taser with a device that can take an electrocardiograph (ECG), a common technique for measuring heartbeat and heart rate. Their goal was to make an ECG that didn’t interfere with the taser’s primary function—to shock and incapacitate people. Once they did that, they tested it on six subjects, tasing them and taking their ECG readings. None of them had any adverse effects, so the researchers can’t say for sure whether their ECG readings would help officers protect suspects who have been tased, or even if they would be able to tell if a patient was at risk.

The modified device is intended to be a proof-of-concept, the researchers write. Future tasers could be outfitted with devices to read suspects’ heart rate or even respiratory rate that could automatically notify healthcare workers if a suspect is in danger.

Of course, this doesn’t make tasers any safer per se—suspects are still receiving a strong shock. But if ECG readings might help save lives, then they might be worth including in future stun guns.