Node-compatibility, adding document check