fixed bug within isAuthenticated policy