added validation checking for a valid URL