Added sleep to scanner in case there are pending messages in queue.