added validation to forms and edit functionality