fix iterator bug