Correct tab is selected when it is clicked on