fixed some search bugs