to fixup when the calling buffer not large enough