Getting into an unconditional loop while calling a command from Event

HI,
Below is my code I am emitting command from a loop CommandHandler and at the end I am applying an event from that event I am trying to emmit another command as soon as I try to do that I get into a unconditional loop. Please help to suggest what am i doing wrong here.

@CommandHandler
public void handle(InitateKotaxTaxTransactionCommand initateKotaxTaxTransactionCommand) {
SAXParserFactory factory = SAXParserFactory.newInstance();
try (InputStream is = getXMLFileAsStream(xmlloadPath + initateKotaxTaxTransactionCommand.fileName)) {
SAXParser saxParser = factory.newSAXParser();
saxParser.parse(is, itemLoaderServiceImpl);
this.individualTaxLine = itemLoaderServiceImpl.getResult();

	} catch (ParserConfigurationException | SAXException | IOException e) {
		e.printStackTrace();
	}
	
	this.individualTaxLine.forEach((taxLine) -> {
		commandGateway.send(new GenerateChallanCommand(this.crnNo, taxLine.getPan(), taxLine.getAssessmentYear(),
				taxLine.getBasicTax(), taxLine.getEduCess(), taxLine.getInterest(), taxLine.getMajorHead(),
				taxLine.getMinorHead(), taxLine.getNaturePymnt(), taxLine.getOtherAmt(), taxLine.getPenalty()));
	});
	AggregateLifecycle.apply(new KotaxTaxTransactionInitatedEvent(initateKotaxTaxTransactionCommand.crnNo,
			initateKotaxTaxTransactionCommand.fileName, this.individualTaxLine,initateKotaxTaxTransactionCommand));

}

@EventSourcingHandler
public void on(KotaxTaxTransactionInitatedEvent initateKotaxTaxTransactionCommand) {
	this.crnNo = initateKotaxTaxTransactionCommand.getId();
	
	this.status = FileStatus.TXN_INITIATED;
	commandGateway.send(new MakePaymentCommand(initateKotaxTaxTransactionCommand.getId(),initateKotaxTaxTransactionCommand.individualTaxLine));
}

//Below command gets into an unconditional loop.
@CommandHandler
public void handle(MakePaymentCommand transformFileCommand) {
if(this.status == FileStatus.TXN_INITIATED) {
var totalTaxAmt = transformFileCommand.individualTaxLine.stream().filter((row)->row.isCrnGenerated()).collect(Collectors.toList()).stream().reduce(0,(subtotal,amt)->subtotal+amt.getTotalAmt(), Integer::sum);
System.out.println(“#########################”+totalTaxAmt);
}
}

The problem here is that you send a command from an EventSourcingHandler. This means that every time the aggregate is loaded from the event store it creates a new command. If the command is sent to the same aggregate, Axon loads the aggregate (if it is not cached), causing it to execute the EventSourcingHandlers again, which sends a new command.
It is better to send the command from a normal EventHandler in another component, this way it is only sent once.

Still getting same issue.

Did you put the event handler that sends the command in a different component?

What I would do is to create a separate component, and add an event handler for the KotaxTaxTransactionInitatedEvent there. In that event handler I would send the MakePaymentCommand, and remove the sending of the command from the event handler in the aggregate class.