refactoring + onLoad message box main window freeze bug