fixed iterative bug