Added isValidUrl method