Move pool-checks into a function
Check for dead threads and restart them