fix write log