fix ring_buffer problem