diff --git a/ohmpi/utils.py b/ohmpi/utils.py
index 9bd16384b7abe1cd0bdbe772cdb8785d45eb1ae1..b29869447f0dc45d9298d90b640f5a8ce9a39308 100644
--- a/ohmpi/utils.py
+++ b/ohmpi/utils.py
@@ -77,7 +77,7 @@ def parse_log(log):
                 tag.append(line.split(" | ")[2].split(":")[0])
                 print(i, line)
                 if tag[-1] == 'INFO':
-                    if 'NEW SESSION' in msg[i]:
+                    if 'NEW SESSION' in msg[-1]:
                         s += 1
                 session.append(s)
             elif "{" in line or msg_started: