added a threadPool parameter to the HTTPAgent