added some validations that limit saving and display error messages