replace escape with encodeURIComponent