update ring buffer