Adding check for class existence.