wait to doc ready