Use a window-global variable to make sure events are not bound more than once