Changed check for dialog buttons