Close the dialog in order to fire closed event.