Used a method for validation.