Fixing socket comunication from server to client