changed iterator, compiles but run into error