semi working, need to clear undo stack after editing after undos