Fixed a log close issue