issue #48 better recursion detection