fix valve index overflow issue, and delete useless old definition.