diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
index f38fbfeedb7a990d8c158f3f9b73a32bfe5bf232..82117654a810fbf7bc71ab12afdb6399ea8f8631 100644
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
+++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py
@@ -949,7 +949,7 @@ if rec.doFileMetaData():
         if 'xAOD::CutBookkeeperContainer_v1' in set(metadata_items.values()):
             logRecExCommon_topOptions.debug("Existing CutBookkeeperContainer found")
             hasBookkeepers = True
-    if hasBookkeepers or hasattr(runArgs, "reductionConf"): # TODO: no other way to detect we are running derivations
+    if hasBookkeepers or ('runArgs' in dir() and hasattr(runArgs, "reductionConf")): # TODO: no other way to detect we are running derivations
         # TODO: check all DAOD workflows
         from EventBookkeeperTools.CutFlowHelpers import CreateCutFlowSvc
         logRecExCommon_topOptions.debug("Going to call CreateCutFlowSvc")