fix pieceLength