Use excepthook for threads