That's called engine run on. This happens on older vehicles that has an external voltage regulator and it's due to a small amount of voltage going through the charging system to the charging lamp indicator. What you need is a 1a-100v diode installed into the circuit that prevents this connection.