added more validation.