Fixing progress bar bug