Modified CommandHistory methods of undo and redo separately