diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py
index 6f9f9ebb90d0733d1aa96810053740fd62019dd9..25640689092de557880300547b910e1e9288019c 100755
--- a/xfel_calibrate/calibrate.py
+++ b/xfel_calibrate/calibrate.py
@@ -795,12 +795,10 @@ def run():
                 if "run" in args:
                     rr = args["run"]
                     # Only put run, when it is not in the folder path
-                    # (e.g. out-folder from webservice conf)
-                    if "r{:04d}/".format(rr) not in out_path and\
-                            "{}".format(rr) not in out_path:
-                        if isinstance(rr, int):
-                            out_path = "{}/r{:04d}/".format(out_path, rr)
-                        else:
+                    # (e.g. out-folder from webservice config)
+                    if isinstance(rr, int):
+                        rr = "r{:04d}".format(rr)
+                    if "{}".format(rr) not in out_path:
                             out_path = "{}/{}/".format(out_path, rr)
             else:
                 print("No 'out_folder' defined as argument, outputting to '{}' instead.".format(