refactored search to use AJAX