valid_reg reset val bug fix