Can't get or set dialog title after it was loaded

Can't get or set dialog title after it was loaded

Hi

I have a dialog, now I want to change it's title, but am unable to do so.

dialog.dialog("option", "title", 'test');

does nothing and

alert(dialog.dialog('option', 'title'));

alerts [object Object] rather than the actual title of the dialog.

What am I doing wrong?