recursion bug has been fixed