Checking if node.scopeName is not null before executing toLowerCase