added a 5s delay for empty queues