fixed bugs in search