Update Agent.scala

Removed the reference to close method since its removed from 2.2