fixed error in detecting logged-in users