fixed the bug where when editing or creating a lesson plan, errors would make the edits disappear