wait for a particular condition befefore continuing in some cases