Ensure beanstalk connection is closed when tool finishes