Modified variables in missed for loops