fixing a bug with isAuthenticated policy