fix crash at undo in digitize