Making the progress bar work