decide tab by index