use multi-thread, fixe crash bugs and change ui slightly