changed isLoggedIn to loggedIn