should shutdown the thread pool if there was an error