changed doc pointer to node pointer