preparing the handling of the "undo" feature