Fixed creating log file before the directory