Fixing progress function.