That's scary!
That's the reason I have my iron on a serge protector in a socket that's connected to the wall switch. A lamp is attached also. If the lamp is on so is the iron. If the lamp is off, so is the iron. Then I check it twice before I leave the room!
Glad you are safe.