Add shutdown hook for multithreading