- fixed a issue with theorem reference where error was thrown before the data could be saved