working on the issue with multiple iterations