fix infinite recursive loop