edited js for search terms