fixing the math in progress bar