fixed some bugs with the seach