improved exception handling, sending messages to gui, and having system exit
small fix, when exiting failed application