fixed log memory leak