validate method