- added a check if a thread died
- formatting