added validations to edit as well