fix serialization of rig