modify kill agents method