Added the validate method