iterator doesn't work

When I compiled your code it didn't work in my system.
That's why I did that change