fix to get correct active tab