Fix window.INVITES to use onDocumentLoad