diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py
index 08311e921820fe795d142e3c42f575d96508d681..b46bb0864479835a9ca9d125cd4a7a2013c090a6 100755
--- a/xfel_calibrate/calibrate.py
+++ b/xfel_calibrate/calibrate.py
@@ -795,7 +795,8 @@ def run():
                     rr = args["run"]
                     # Only put run, when it is not in the out_folder
                     if isinstance(rr, int):
-                        args["out_folder"] = "{}/{}/".format(args["out_folder"], rr)
+                        rr = "r{:04d}".format(rr)
+                    args["out_folder"] = "{}/{}/".format(args["out_folder"], rr)
                 out_path = os.path.abspath(args["out_folder"])
             else:
                 print("No 'out_folder' defined as argument, outputting to '{}' instead.".format(