When verifying that the overlay is removed, you should first verify that the overlay exists while the dialog is open.