Fixed infinite recursive loop