get correct nane if resource_id has been set