fix undo redo bugs
it just works