added validation in the models