change the implementation of IsInstanceOf (more accurate) and added IsClassOf with the previous code of IsInstaceOf