fixed a few issues in searchbar code