finish mainWindow