fix serializer with primary keys