Fixed error where data array was recreated for each pilot creating incorrect JSON