fixBugCloseMainWindow