fixes to login check
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 88d7a33..c53f1c1 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -7,8 +7,9 @@
 		called from login manager, before login
 	"""
 	try:
-		import server_tools.gateway_utils
-		server_tools.gateway_utils.check_login()
+		if login_manager.user not in ('Guest', None, ''):
+			import server_tools.gateway_utils
+			server_tools.gateway_utils.check_login(login_manager.user)
 	except ImportError:
 		pass