added ability to specify agent