updating AJAX functions