quit when main window closes