diff --git a/notebooks/DynamicFF/Characterize_DynamicFF_NBC.ipynb b/notebooks/DynamicFF/Characterize_DynamicFF_NBC.ipynb
index 2ca437be4e82d851fb5e8d2ab82bc2f4c15953ec..dc41c2ed4b6ea603d0f89d33d34b5a24b7a1662f 100644
--- a/notebooks/DynamicFF/Characterize_DynamicFF_NBC.ipynb
+++ b/notebooks/DynamicFF/Characterize_DynamicFF_NBC.ipynb
@@ -47,6 +47,8 @@
     "import os\n",
     "import warnings\n",
     "from logging import warning\n",
+    "from shutil import copyfile\n",
+    "from tempfile import NamedTemporaryFile\n",
     "\n",
     "warnings.filterwarnings('ignore')\n",
     "\n",
@@ -285,7 +287,8 @@
     "step_timer.start()\n",
     "\n",
     "# Output Folder Creation:\n",
-    "os.makedirs(out_folder, exist_ok=True)\n",
+    "if local_output:\n",
+    "    os.makedirs(out_folder, exist_ok=True)\n",
     "\n",
     "def inject_ccv(in_folder, metadata_folder, runs, calibration, cond, pdu, const_input, begin_at):\n",
     "    print(\"* Send to db:\", const_input)\n",
@@ -307,20 +310,23 @@
     "            'data': constant[\"data\"],\n",
     "        }}}}\n",
     "\n",
-    "        ofile = f\"{out_folder}/const_{constant_name}_{db_module}.h5\"\n",
-    "        if os.path.isfile(ofile):\n",
-    "            print(f'File {ofile} already exists and will be overwritten')\n",
-    "\n",
-    "        save_dict_to_hdf5(data_to_store, ofile)\n",
-    "        if db_output:\n",
-    "            inject_ccv(\n",
-    "                in_folder, metadata_folder, [dark_run, flat_run],\n",
-    "                constant_name, conditions, pdus[\"data\"][constant[\"pdu_no\"]],\n",
-    "                ofile, constant[\"creation_time\"]\n",
-    "            )\n",
-    "\n",
-    "        if not local_output:\n",
-    "            os.unlink(ofile)"
+    "        with NamedTemporaryFile() as tempf:\n",
+    "            save_dict_to_hdf5(data_to_store, tempf)\n",
+    "            \n",
+    "            if db_output:\n",
+    "                inject_ccv(\n",
+    "                    in_folder, metadata_folder, [dark_run, flat_run],\n",
+    "                    constant_name, conditions, pdus[\"data\"][constant[\"pdu_no\"]],\n",
+    "                    ofile, constant[\"creation_time\"]\n",
+    "                )\n",
+    "                \n",
+    "            if local_output:\n",
+    "                ofile = f\"{out_folder}/const_{constant_name}_{db_module}.h5\"\n",
+    "                \n",
+    "                if os.path.isfile(ofile):\n",
+    "                    print(f'File {ofile} already exists and will be overwritten')\n",
+    "                \n",
+    "                copyfile(tempf.name, ofile)"
    ]
   },
   {