changed logging to display correct iteration