fixed isUsed freeze, added possible infinite recursion