fixed the append of log file