Close the dialog once the record is saved