event listener is turning on and off