fixed ajax call to iterate through