fix compiation error for clang++
fix bug of recursive call