fix a bug cause exception when click meun->port->open as the port is opened.