finall fixed search bug