implemented the progress bar functionality