Check if thread exists