Fix the wait condition, no need to wait when already done or cancelled
2 files changed