diff --git a/webservice/update_config.py b/webservice/update_config.py
index b732c06e4d6a40aa40b8fb6ddcfbb86028be3df3..5612a0bb3e90c3b88049a3fccf88f399162ba523 100644
--- a/webservice/update_config.py
+++ b/webservice/update_config.py
@@ -1,4 +1,5 @@
 import argparse
+import copy
 import json
 import sys
 
@@ -35,9 +36,6 @@ if "--help" in sys.argv:
     sys.argv.remove("--help")
     add_help = True
 
-# Save available_options before adding bool keys with "no-".
-prev_available_opt = available_options
-
 for det, val in available_options.items():
     bool_keys = []
     for k, v in val.items():
@@ -53,7 +51,6 @@ detector = args["detector"]
 if detector is not None:
     for option, typ in available_options[detector].items():
         if typ == list:
-            print(typ)
             nargs = '+'
         else:
             nargs = None
@@ -83,7 +80,7 @@ for key, value in args.items():
                 value[value.index(v)] = ''.join(v)
 
         if 'no-' in key and isinstance(value, bool):
-            if key not in prev_available_opt[detector].keys():
+            if key not in bool_keys:
                 new_conf[task][instrument][detector][key.replace('no-','')] = False
             # avoid saving the "no-"key into the updated config
             continue