fixed thread destroying