fixed bug in log file write reduction