shutdown pools correctly