Adding checks for retry and schedule queues