fixed thread error