Removing window event listeners when the event happens