replaced urlencode with rawurlencode