fix logit optimal value: take weight into account