Fix waiting bug