Added AJAX for sorting.