modify to remove useless branch