fix bug in search.js