Fix log bug