added some AJAX functionality