Fixed $currentTab issue