serialize arrays of non-primitives