fixed close cfg file