fixed reconnect issue in cmdline tool