closes #237 correct looping ID's. they got reset because of the loop in a loop.