fixed data length bugs