fix log file creation bug