before test duplicate name issue
optimise duplicate name search logic