Fixed window on close handler