escaping the strings so the server doesn't disconnect