updated js for custom search ajax call