added CloseAllThreads