fix the problem that data is no onough when read from ring buffer