iterator bug fix