fix recursive calls