Somehow the close dialog doesn't always fire.