fix error with iterator