fixes bug within agent handler