hook  for  thread exceptions