fix crash error in ringbuf