error check on undo call