main window exits cleanly