You know how the old saying goes, “If you can’t keep your phone from blowing up, recreate it with a built-in fire extinguisher.” OK, so maybe we made that up, but that doesn’t mean researchers aren’t trying to construct batteries with built-in fire extinguishers.

You may remember last year when Samsung had to recall an entire line of phones because the lithium-ion batteries were causing them to blow up. Batteries are designed to store a lot of energy and release it over time. But with the Samsung phones, something would malfunction and that energy would release all at once and turn the once seemingly harmless phone into a miniature bomb.

Luckily, a group of researchers at Stanford may have found a solution. Instead of developing a battery that won’t explode, these researchers have found a way to assemble the phone with a fire extinguisher built into the device. But, how?

According to the BBC, “Flame retardant triphenyl phosphate (TPP) sits inside a shell within the electrolyte fluid. The shell melts when the temperature reaches 150C (302F), releasing the chemical compound. In tests, battery fires were extinguished in 0.4 seconds.”

There you have it. Exploding batteries now have the ability to put out their own fires and we are officially in the future.