Adde some error handling when reading from config file