Fixed bug for socket.