Dialog Destroy Method

Dialog Destroy Method

Each time i close my dialog i use the destroy method:
  1. $(this).dialog("destroy")
The problem is that every time i close the dialog and try to initiate it again i get this error, but on the second click it gets open

  1. b("<div></div>").addClass("ui-widget-overlay") is undefined