working on the validate method