Hy awk, you are probably using the ignition terminal on the ignition switch as your alternator excitation wire, when you turn the ignition switch to the off position the alternator back feeds the ignition circuit. Depending on which alternator you have, you could install a diode in the alternator excitation wire to prevent backfeeding the ignition circuit, or you could purchase something called DA plug which plugs into the alternators two terminal connection and has the diode incorporated into it, hope that helps.