Add id for subclasses.