added ability to specify when to use persistent http client