Deep copy data before serializing