waiting the doc is ready