implemented nested serialization for fields