Minor bug fix in search.js