fixed sleep behavior to not sleep when the process is the last one we'd run,