refactored showTab to be more correct