try a local buffer before inserting into output buffer