fixed some bugs in the search backend