set up the validate method