plugin commitment: use while instead of for loop