fix dialog closing