fixed ensureAuthenticated
fixed ensureAuthenticated