fixed the AJAX bug