progress bar now stops when length is reached