setting value properly for search result js