using JSON.stringify() to convert object to string before passing to encodeURI()