fixed search bug with leading duplicate characters