fixing ensure_auth_token problem