getNode function fixed

Forgot to assign the node if it is missing.