An attempt to stop the ajax call from continuing indefinitely