fixed "return nodesJson.length;" nodesJson is undefined