Fix wrong tab getting activated