fix repwd bug