catch exceptions in all threads