added min number of threads while cleanup