Updated agent.coffee