window close fix.