make sure document is released
Free a node when unlink it