fixed expert mode, added termination of threads on window closing