add socket.error handle to server