Adding check if class exists.