shutdown pools properly