making sure all threads are shutdown