dialog plugin only fires once.

dialog plugin only fires once.

Hi everyone!
I am having an issue with the dialog plugin. I have the latest jquery and dialog version installed.
I have a link that opens a form into a div and than I create a dialog with that div to display as a modal Iframe. It opens at the first time I fire the open event and it fires correctly the close event when I close the iframe, but when I try to open for the second time without refreshing the form that the dialog div is in it, it just does nothing. Do not create the dialog again nor display it to me if it is already created. I tryed to use the destroy event without success so I am running out of technical experience to solve this problem.

here is the code that fires up the dialog:

function addPedidoCliente() {
    $.ajax({
        url: server+"/ajax/Pedidos/addPedidoCliente",
        data: "",
        cache: false,
        success: function(html)
        {
            $('#formPedidoThickBox').html(html);
            $('#formPedidoThickBox').dialog({width:600,
                                 resizable:false,
                                 show:'slide',
                                 hide: 'slide',
                                 draggable: false,
                                 modal: true,
                                 close: function(ev, ui) { $(this).destroy(); alert("close");}
                                 });
        }
    });
}

So every time I click on a specific button, this code is called, it is also performing the ajax request as I can see in firebug (the response is ok as well) but the dialog Iframe is not created.

Could you guys gimme some help here?
Thanks