fix bug in __iter__