Fix JS syntax in Search function