Added pool join and close statements