correctly serialize and linkTo principals