Stop listening to events on close