fixed validation check to add the url if invalid