Replaced escape/unescape with encodeURI/decodeURI