Fix escaping issue with encodeURI