Added a little bit of model validation