fix write log bug