Replicator Writer does not work for randomization

Hi everyone, I tried to randomize cars in my scenery, trigger the randomization and save the frame image. The problem was the randomization worked but there was no frame saved in my folder. The below is my code

import omni.replicator.core as rep

with rep.new_layer():
camera = rep.create.camera(position = (-4212, 1047, 4522), rotation = (0, -65, -5))
render_product= rep.create.render_product(camera, (1024, 1024))

def cars_move():
	cars = rep.get.prims(semantics=[('class','SD'),('class','CP'),('class','SUV'),('class','MV')])
	
	with cars:
		rep.modify.pose(
			position=rep.distribution.uniform((-4000,0,-4000),(0,0,000)),
			rotation=rep.distribution.uniform((-90,0,0),(-90,180,0)),
		)
		rep.modify.visibility(rep.distribution.choice([True, False]))
		
	MTs = rep.get.prims(semantics=[('class','MT')])
	
	with MTs:
		rep.modify.pose(
			position=rep.distribution.uniform((-2500,0,-1000),(1000,0,2000)),
			rotation=rep.distribution.uniform((0,0,0),(0,180,0)),
		)
		rep.modify.visibility(rep.distribution.choice([True, False]))
		
	return cars.node, MTs.node


#Randomization Register
rep.randomizer.register(cars_move)

result_path = "C:/Users/VOTRANDANGKHOA/Downloads/Result"

with rep.trigger.on_frame(num_frames=500):
	rep.randomizer.cars_move()
writer = rep.WriterRegistry.get("BasicWriter")
writer.initialize(
	output_dir=result_path, rgb=True, 
	semantic_segmentation=True, 
	)
writer.attach([render_product])

rep.orchestrator.run()