serialization stackoverflow fix

Does labeledinstnace have a generic argument? maybe we can fix that later.