improve the way to decided when a tab name needs to be updated after removing one