Updated tcpserver handler