fixed bug on collect iterator