renamed ambigous global loop variable