Adding new wait to check for active AJAX calls. Will wait until calls have completed.