When I wait for the ajax request to finish