Replaced the urlencode code