[PATCH] Run exception handling in the main thread also in TUI