fix infinite recursion