threads sync bug fixed