Reset ending flag in dequeue