fix how we write the array