urlencode query string to fix http 505 error