serialize the array