diff --git a/interface/lib/classes/tform_actions.inc.php b/interface/lib/classes/tform_actions.inc.php
index 0593c031fb9d4dfcd57962aa4f9e86db543d7b62..f676b325662c90a1475cd2f529fa6be9722b81ba 100644
--- a/interface/lib/classes/tform_actions.inc.php
+++ b/interface/lib/classes/tform_actions.inc.php
@@ -195,7 +195,7 @@ class tform_actions {
                         }
 
                         $this->onAfterInsert();
-						
+
 						// Write data history (sys_datalog)
 						if($app->tform->formDef['db_history'] == 'yes') {
 							$new_data_record = $app->tform->getDataRecord($this->id);
diff --git a/interface/web/sites/cron_edit.php b/interface/web/sites/cron_edit.php
index a3244f0ebf4f87908dcd0476b79d4a5dde1aac46..54d021a2c32378af8898255276c1acbb122a5b65 100644
--- a/interface/web/sites/cron_edit.php
+++ b/interface/web/sites/cron_edit.php
@@ -168,8 +168,9 @@ class page_action extends tform_actions {
         if($has_error == true) {
             parent::onError();
             exit;
-        }
-        else parent::onInsertSave($sql);
+        } else {
+			return parent::onInsertSave($sql);
+		}
     }
     
 	function onAfterInsert() {