Handle correctly switching between different queues.