Add synchronization where wait() is called