Fixed faulty recursion