Auto retry in ajax calls