fix the if-else branch traverse