change regdistrictofficial to function