adding logic for "progress bar"