fix placement of dereference when building serialization