Fix infinite recursive loop