bugfix: close open port when main window close