Added missing windowCloseEvent