add new features for handling exception in multi-thread