add wait and notifyAll