refactor gui
disable implicit exit, and use background thread again