Update agentservice.js