Fixed bug with log file lock