fix wait condition

Change-Id: Id29e2fe07f85b5ada6ff02479a2320fa4ac2be4d