cleaned up unused function
handle logoff and disconnect events with handleLogoff function