fix proc_sweep off by one error