manually serializing the main record