Corrected incorrect variable in for loop due to previoud commit