added a loadConfig function