   // We need to wait the initialization in order to enable GPRS
   // So...
   delay(10000);
-  for (int i = 0; i < 4 && !fona.enableGPRS(true); i++)
-  {
+  for (i = 0; i < NUM_RETRIES && !fona.enableGPRS(true); i++) {
     Serial.println("FONA GPRS not enabled!");
     delay(10000);
+  }
+  if (i >= NUM_RETRIES) {
+    Serial.println("Failed to enable GPRS!");
+    return false;
   }
   
   if (!fona.enableNetworkTimeSync(true)) {

    Serial.print("Size: ");
    Serial.println(strlen(buffer));

    // Send message
    if (!fona.sendSMS(destination, buffer)) {
      Serial.println(F("SMS failed"));
    } else {
      Serial.println(F("SMS sent!"));
    }

    if (!send_http_post(http_post_url, id, buffer)) {
      Serial.println(F("HTTP POST Failed"));
    } else {
      Serial.println(F("HTTP POST Sent!"));

  digitalWrite(FONA_EN_BAT, HIGH);
  
  // See if the FONA is responding
  for (i = 0; i < NUM_RETRIES; i++) {
    if (fona.begin(Serial2)) {
      break;
    }
    delay(1000);
  }
  if (i >= NUM_RETRIES) {
    Serial.println(F("FONA not found"));
    return false;
  }
