added correct code to search.js