finally fixed all bugs for quicksearch