wire up the dialog buttons correctly