Updated controller to respect the shouldManageSelectionUndo property