fix loitering bug in dequeue