After shake effect, applied to UI Dialog element, ends, dialog is removed from the DOM... ?

After shake effect, applied to UI Dialog element, ends, dialog is removed from the DOM... ?

I've got custom made widget, which is derived from UI Dialog (nothing special), some additional logic on header and footer. Now I try to "shake" it in specific cases with $.effect("shake") and it is does as expected, but when the effect ends UI Dialog is destroyed. Is there any way to prevent this?