optimize unique string test a bit more