creating a method to validate