Updated logic for magento default root directory