fix dialog bugs