404 ReferenceError: document is not defined