Add scope check for overlapping names