bug fix: wrong iteration order after refresh()