fix write block bug