preparing for undo actions