tabs method select doesn't update 'option' 'selected'

tabs method select doesn't update 'option' 'selected'


When i use the method select to select a tab it doesn't update the
option selected attribute.
If i click the tab with the mouse the selected attribute is updated as
it should.
This is what i do:
    $('#tabs').tabs({
        select: function(event, ui) {
            if($(ui.tab).text() == "+") {
                usedlistid++;
                $("#tabs").tabs('remove',ui.index);
                $("#tabs").tabs('add','ajax.php?listid=' + usedlistid,'Lista');
                $("#tabs").tabs('select',ui.index);
                $("#tabs").tabs('add','#tabs-1','+');
                return false;
            }
        }
});
What it does is that it creates a new tab and puts an empty tab with a
+ sign at the end.
Then i want to select the newly created tab.
Everything works the correct tab gets selected but the 'option'
'selected' attribute doesn't.
So when i run this code:
selectedtab = $("#tabs").tabs('option', 'selected');
It returns the index of the last selected tab that i selected using
the mouse.
I tried setting the selected attribute but it didn't help it still was
the old value...
Do i need to add something else to the code or?