bug fix in ring_queue