Removing tabSelected(n) completely seems to work fine