fix validate method