small change in wait()