fix JSON add Inbounds and tail recursion