Added extended error handler to the ajax pulls. Function now retries ajax if ajax fails first time.