Added checking for existing class Mage and checking for readable
Class Mage detection changes