changed CGI to url_encode