Sorted out the terminating of the pools