update main window and add new tab to it