Ensure that config file is closed immediately