add some multithreading for progress bar