add pool close to try except