document and test recursion prevention