fix some bugs in search
fix some bugs in search