fix both infinite recursion by detecting it