working in a hook for pact serialisation