added checks to ensure node/edge entity use is expected