Fixed looping through data