fixed the potential bug that the preferred thread probably cannot be found