error fixed in validate method