add finally to close the thread pool