update and fix onTabSelect