Select the tab based on which is clicked on, not based on the name clicked on