fixed thread startup/exit checks