What does the code look like now then?

Are you printing after doing index++ by any chance?

// Json