fix dialog close issue