diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
index 157dac917a944416dc41368d73dc0a14ca892a76..af1f2532e5253bb7077ebafc8a7de7ed1e2e823c 100644
--- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
+++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb
@@ -277,8 +277,7 @@
     "        missing_gain_constants = {\n",
     "            \"BadPixelsFFGotthard2\", \"RelativeGainGotthard2\"} - set(calibrations)\n",
     "        if gain_correction and missing_gain_constants:\n",
-    "            warning(f\"Gain constants {missing_gain_constants} are not retrieved for mod {mod}.\"\n",
-    "                    \"Gain correction is disabled for this module\")\n",
+    "            warning(f\"Gain constants {missing_gain_constants} are not retrieved for mod {mod}.\")\n",
     "\n",
     "        # Create the mask array.\n",
     "        bpix = const_data[mod].get(\"BadPixelsDarkGotthard2\")\n",
@@ -296,6 +295,9 @@
     "        if const_data[mod].get(\"RelativeGainGotthard2\") is None:\n",
     "            const_data[mod][\"RelativeGainGotthard2\"] = np.ones(\n",
     "                (1280, 2, 3), dtype=np.float32)\n",
+    "            if gain_correction:\n",
+    "                gain_correction = False\n",
+    "                warning(\"Gain correction is disabled for this module.\")\n",
     "        const_data[mod][\"RelativeGainGotthard2\"] = const_data[mod][\"RelativeGainGotthard2\"].astype(  # noqa\n",
     "            np.float32, copy=False)  # Old gain constants are not float32.\n",
     "\n",