Remove cached identifier on delete

adding a bit more to #158 to also handle child nodes.