Modify telnet logic