updated the way to know if a url is valid