Added extra error handling to the queue.