fixed bug that reassigned iteration