properly serialize with deserialized data