diff --git a/docs/pyerrors/input/hadrons.html b/docs/pyerrors/input/hadrons.html
index 95d118ca..aaf486d2 100644
--- a/docs/pyerrors/input/hadrons.html
+++ b/docs/pyerrors/input/hadrons.html
@@ -110,7 +110,7 @@
17 raise Exception('No files starting with', filestem, 'in folder', path)
18
19 def get_cnfg_number(n):
- 20 return int(n[len(filestem) + 1:-3])
+ 20 return int(n.replace(".h5", "")[len(filestem) + 1:]) # From python 3.9 onward the safer 'removesuffix' method can be used.
21
22 # Sort according to configuration number
23 files.sort(key=get_cnfg_number)