Changed to doc.ready

Update to doc.ready to support post loaded use cases.