Isn't this dangerous though? What if on key down you replace a node but it ends up having the same id? Then the event will go to the wrong node.