Fix case in progress when loop finishes too early