improve undo history