fix dialog buttons linking logic