Fixing nodeId in JS