add validate to model