Closing the thread.