iteration bug fixed