Fixed userIsLoggedIn method