fixing window close