handle telnet errors correctly