fixed connecting to remote host and listening