lazy buffer creation to avoid crash in unit test