current tab function working