wait for response to avoid race condition while testing