Added isLoggedIn helper method