use deep cloning to update undo/redo