Check ids exist when serializing