Fixed isLoggedIn to compare titles instead of role objects