add default value for weight.