forgot to update the todo indices after sorting - fixes issue #5