Agent bug fix