change when to stop the progress bar