Added config file validation and made code more robust for internet outage