Fixed ensure_authentication_token issue