Made buffers thread safe