reorder the queue