diff --git a/perun/proxy/utils/nagios/check_saml.py b/perun/proxy/utils/nagios/check_saml.py
index 269638afc39f19caa086c9bedf05a471c0e331af..530d6d68e619f0cec49ee40bfd086570a7119ef6 100755
--- a/perun/proxy/utils/nagios/check_saml.py
+++ b/perun/proxy/utils/nagios/check_saml.py
@@ -315,7 +315,7 @@ class SAMLChecker:
             print(response_html)
 
         # MFA
-        if "TOTP" in response_html or "privacyIDEA" in response_html:
+        if "totp" in response_html.lower() or "privacyidea" in response_html.lower():
             if self.args.verbose >= 1:
                 print("MFA is required")
             totp_form_action, totp_form_data = parse_form(response_html)
@@ -521,11 +521,11 @@ class SAMLChecker:
                     "CRITICAL",
                 )
 
-            self.finish(
-                "Authentication took {:.2f} seconds".format(elapsed_seconds),
-                status,
-                auth_time=elapsed_seconds,
-            )
+        self.finish(
+            "Authentication took {:.2f} seconds".format(elapsed_seconds),
+            status,
+            auth_time=elapsed_seconds,
+        )
 
     def __init__(self, args):
         self.args = args