error handling in thread jobs