fix recursion problem