Fix the progress bar javascript