added validations in model and views