bug fixes
subdistribution code generate