diff --git a/e107_handlers/e_customfields_class.php b/e107_handlers/e_customfields_class.php
index fc365d03a..e55aed181 100644
--- a/e107_handlers/e_customfields_class.php
+++ b/e107_handlers/e_customfields_class.php
@@ -67,7 +67,14 @@
 
 			if(is_array($data))
 			{
+				if(isset($data['__tabs__']))
+				{
+					$this->_tab = $data['__tabs__'];
+					unset($data['__tabs__']);
+				}
+
 				$this->_config = $data;
+
 				return $this;
 			}
 
@@ -305,6 +312,7 @@
 
 		public function renderConfigForm($name)
 		{
+
 			$frm = e107::getForm();
 			$curVal = $this->_config;
 			$value = array();
@@ -320,7 +328,6 @@
 				}
 			}
 
-
 			$text = "
 			<div class='form-group'>
 				".$frm->text('__e_customfields_tabs__', $this->_tab[$this->_tab_default], 30, array('placeholder' => 'Tab label', 'size' =>'medium', 'required' =>1))."
diff --git a/e107_tests/tests/unit/e_customfieldsTest.php b/e107_tests/tests/unit/e_customfieldsTest.php
index f1383f236..4a117b485 100644
--- a/e107_tests/tests/unit/e_customfieldsTest.php
+++ b/e107_tests/tests/unit/e_customfieldsTest.php
@@ -17,7 +17,7 @@
 
 		protected $config = '{
 		    "__tabs__": {
-                "extra": "My Tab"
+                "additional": "My Tab"
             },
 		    "image": {
 		        "title": "Image",
@@ -191,6 +191,8 @@
 				$this->fail("Couldn't load e_customfields object");
 			}
 
+			$this->cf->__construct();
+
 			setlocale(LC_TIME, 'C');
 			date_default_timezone_set('UTC');
 
@@ -313,12 +315,18 @@
 		{
 
 		}
-
+*/
 		public function testRenderConfigForm()
 		{
+			$this->cf->loadConfig($this->config)->loadData($this->data);
+			$tab = $this->cf->getTabId();
+			$this->assertSame('additional', $tab);
+
+			$result= $this->cf->renderConfigForm('custom');
+			$this->assertStringNotContainsString('__tab__', $result);
 
 		}
-
+/*
 		public function testGetFieldValue()
 		{