Check tab exists before trying to click it