fix sample code that supposed to iterate 10 times.