added check for valid url