fixed dumb inverted comparison in cha, as well as adding proper id gen for hsr