Fixed never-ending recursion