implemented thread safe buffers