Add sychronized to wait and notify