breaking thread code