do not use the same var for second loop, it's first place to create a bug