fix write size error