added retries when encountering the ClosedPoolError