just to add in case anyone run's into this problem - if you have multiple dialogs stacked on top of each other then the following will close just the dialog that's at the top:
$(".ui-widget-overlay").live("click", function () {
$(".ui-dialog-titlebar-close", $(this).prev()).trigger('click');
});