fix the queue bug