fixed the wait() test for new changes