add ring buffer structure