Queues defensive code