added some robustness to the config system