fixed wrong serialization of nested messages