fix another bug in resource.context_agents()