[UPDATE] remove document argument. Assign document to global when Node.