fixed CreateThread issue