fix some odd code