main window bug fixed