Fix waiting bug.