changed the api for tabswitch