fixes
close pool properly when done