utils: fixed extraneous var in for loops