fix issue where wrong tab selected