Add logic for progress bar