engine dying due to electric fan

You cannot connect anything to the ignition circuit. It's for the ignition. The fan is a high amp draw. Your connection is anything but "proper".

You should run the fan from a dedicated switch, through a relay, possibly through a thermostatic switch if you want and to the fan.