add error form to edit and clean up