fix serialization of nested data