unbind event when the window is shut down