fix recursion issue