fixing clear cache bug for agentids array