Fix an issue to return list of nodes from new function