fix some problems with searching