fixes to error callback triggering (+ changes to edit function) - #673