adding a fix for iterator loop