fixed URIencoding and socket messages