fix iterator implementation