some fixes
store tab title and activate it after script finishes