fix unpaddedLength hack