added validation for edit page