functioning tab selector