Update agentLogic.js