add some validation to model and db