fixed EnsureAuthenticated Method bug.