added logging and an error occuring when you are dont have magento setup correctly