Was looping through wrong variable.