Use encodeURIComponent instead of escape