Made changes to AJAX