fix external_id and scoping