added a small timeout for uncaughtException so it logs before exiting the process