Check for graph using substring rather than exact equals