add progress bar, improve performance