test exceptions in threads