added different handling of url