use url package to parse url; fix commented codes