fix computation of how many tasks have been done