fix progress bar math