Add a delay to ensure the queue is empty
Add required import