added validate url function