fix buffered iteration