improve undo redo