fixed bug in SocketHandler