Cast to array before serializing.