Protect recursive call from exhausting stack depth limit