better way to deal with removeTab