bug fix to traverse_thread