updated validations and made change to update method