fixed repeatedly opening log files