added urlencode as last step to build querystring