Fix for checking unique name of the variable

Reviewer: Chezka Arevalo (post commit)

Issue: GCP-8892