updated controller and agent scripts