fixed main window onFormClosing