use encodeURIComponent instead of escape