some minor changes to how includeDocReady works