Fixed AJAX bug