changed the method initMetadata()

instanceof has been replaced with is_subclass_of