Bug in model validate method