fixed infinite recursion