added errors and validations to edit pages