prevent closing of main window