fixup the all bug in rtgen.py