Handle failure in thread