diff --git a/webservice/webservice.py b/webservice/webservice.py
index dacc6302d491037e95c67e7256e5cec9e86a8b2e..df22c763b8ffba471e2c7968720cffd4dc99c552 100644
--- a/webservice/webservice.py
+++ b/webservice/webservice.py
@@ -691,12 +691,14 @@ async def server_runner(config, mode):
 
                     # --slurm-scheduling is the --nice slurm command
                     # to increase priority by having a lower number.
-                    cmd = ["python", "-m", "xfel_calibrate.calibrate",
-                           detector, "DARK", '--priority', priority,
-                           '--slurm-scheduling', str(config[action]['sched-prio']),  # noqa
-                           '--slurm-name', '{}_{}_{}_{}_p{}_r{}'
-                               .format(action, instrument, detector, cycle,
-                                       proposal, "_r".join(wait_runs))]
+                    cmd = config['dark']['cmd'].format(
+                        detector=detector,
+                        sched_prio=str(config[action]['sched-prio']),
+                        priority=priority,
+                        action=action, instrument=instrument,
+                        cycle=cycle, proposal=proposal,
+                        runs="_r".join(wait_runs)
+                    ).split()
 
                     # Avoid giving a reservation parameter after the
                     # ITDM changes for giving xcal high priority by default
@@ -766,13 +768,13 @@ async def server_runner(config, mode):
 
                     # --slurm-scheduling is the --nice slurm command
                     # to increase priority by having a lower number.
-                    cmd = ["python", "-m", "xfel_calibrate.calibrate",
-                           detector, "CORRECT", '--slurm-scheduling',
-                           str(config[action]['sched-prio']), '--slurm-name',
-                           '{}_{}_{}_{}_p{}_r{}'.format(action, instrument,
-                                                        detector, cycle,
-                                                        proposal,
-                                                        "_r".join(wait_runs))]
+                    cmd = config['correct']['cmd'].format(
+                        detector=detector,
+                        sched_prio=str(config[action]['sched-prio']),
+                        action=action, instrument=instrument,
+                        cycle=cycle, proposal=proposal,
+                        runs="_r".join(wait_runs)
+                    ).split()
 
                     cmd = await parse_config(cmd, dconfig)
 
diff --git a/webservice/webservice.yaml b/webservice/webservice.yaml
index c4b138b761e3d54bc72c1ab056f84b8046b3cfe9..40b0f1f3502d27823eec93094e1f1eaad720de03 100644
--- a/webservice/webservice.yaml
+++ b/webservice/webservice.yaml
@@ -26,9 +26,19 @@ correct:
     in-folder: /gpfs/exfel/exp/{instrument}/{cycle}/p{proposal}/raw
     out-folder: /gpfs/exfel/d/proc/{instrument}/{cycle}/p{proposal}/{run}
     sched-prio: 80
+    cmd : >
+        python -m xfel_calibrate.calibrate {detector} CORRECT
+        --slurm-scheduling {sched_prio}
+        --slurm-name {action}_{instrument}_{detector}_{cycle}_p{proposal}_r{runs}
+        --cal-db-timeout 300000
 
 dark:
     in-folder: /gpfs/exfel/exp/{instrument}/{cycle}/p{proposal}/raw
     out-folder: /gpfs/exfel/u/usr/{instrument}/{cycle}/p{proposal}/dark/runs_{runs}
     sched-prio: 10
-
+    cmd: >
+        python -m xfel_calibrate.calibrate {detector} DARK
+        --priority {priority}
+        --slurm-scheduling {sched_prio}
+        --slurm-name {action}_{instrument}_{detector}_{cycle}_p{proposal}_r{runs}
+        --db-output