adding support for multiple agents