Added validate method to model