fixed a small bug in search.js