optimize progress_bar