I created a function that replaces the `window.alert` function with my own function that utilizes `jquery.dialog`. The problem is that in some functions I call that function and reload the page right afterwards. It is supposed to refresh it when user clicks "OK", but it is reloading the page by itself before I even click "OK".

Here's an example of call sequence in a function:

```
function UpdateCertSucccess(result) {
customAlert("Hello World");
window.location.href = "./SomePage.aspx";
}

```

And here's my defined `customAlert()`

```
function customAlert(message) {
if (!isOpen) {
    $('#error-message-dialog').dialog({
        autoOpen: false, bgiframe: true, position: ['center', 100], modal: true, zIndex: '6000', title: 'R+L Carriers Message', width: 475, height: 250,
        buttons: {
            "OK": function () {
                $(this).dialog("close");
                isOpen = false;

            }
        }
    });
    var elements = message.split("|");
    $('#spMessage').text(elements[0]);
    $('#spCode').text(elements[1]);
    $('#spTime').text(elements[2]);
    $('#spServer').text(elements[3]);
    $('#error-message-dialog').dialog('open');
    isOpen = true;

       }
else {
    $('#spMessage').append("<br /><br />");
    $('#spMessage').append(message);
}
return false;

```

};

What could be causing the page reload before I close the dialog and how can I fix it?
Thanks!