Close the dialog when the user presses OK