fix iteration implementation