Use a local buffer instead of a global buffer