adding a loading indicator for AJAX operations that take longer than a second