refactored isLogged route