fix failed branch of each function