Fix the agent resolution bug with regions having same prefix