fixed bad iterator after code.