adding loading bar to AJAX call