update deprecated method

update deprecated "escape" method to "encodeURIComponent"