update ringbuffer