fixed the notify and wait() bug

fixed the notify and wait() bug