fixed thread issue