Implementing maximum recursion control