bugfix in recursion