added urlencode for URL mode