Added guard to protect against an instance of the confirm dialog already being in the DOM.