You should make sure to remove this event listener in unloadFromWindow.