encode gate name when searching it