diff --git a/docs/simplesamlphp-automated_metadata.txt b/docs/simplesamlphp-automated_metadata.txt
index c2d01b555aa204a97d012025c39aff08cdc265cb..554038426b11b5228afa5c65b4af9de314052428 100644
--- a/docs/simplesamlphp-automated_metadata.txt
+++ b/docs/simplesamlphp-automated_metadata.txt
@@ -110,26 +110,6 @@ Add to CRON with
 
 
 
-Errors
-------
-
-Problem with sanitycheck module
-
-When executing [Run cron [daily]] ==> an error shows up 
-
-Cause : module sanitycheck  ==> It is active by default (`/var/simplesamlphp/modules/sanitycheck/default-enable`) 
-
-  * When executing Cron daily It will search all active modules and it executes the hook_cron.php for each one of them in :
-		`/var/simplesamlphp/modules/<nome_modulo>/hooks/hooks_cron.php`
-
-Meanwhile it is waiting that each module conf file exists in the folder: `/var/simplesamlphp/config/config-<nome_modulo>.php`
-
-It should exist one for the sanitycheck module => `config-sanitycheck.php` but it wasn't there and therefore the error showed up.
-
-Giving an error at this modules it aborted execution for the next active modules.
-
-
-
 Configuring the metarefresh module
 ----------------------------------
 
diff --git a/modules/sanitycheck/hooks/hook_cron.php b/modules/sanitycheck/hooks/hook_cron.php
index 68ee1b20e0703a41ca8807a40f0a678668139cef..049447e3a582668d20b9bc26e7d4da7227ba68c2 100644
--- a/modules/sanitycheck/hooks/hook_cron.php
+++ b/modules/sanitycheck/hooks/hook_cron.php
@@ -13,12 +13,13 @@ function sanitycheck_hook_cron(&$croninfo) {
 
 	try {
 	
-		$sconfig = SimpleSAML_Configuration::getConfig('config-sanitycheck.php');
-		
-		if (is_null($sconfig->getValue('cron_tag', NULL))) return;
-		if ($sconfig->getValue('cron_tag', NULL) !== $croninfo['tag']) return;
-		
-		
+		$sconfig = SimpleSAML_Configuration::getOptionalConfig('config-sanitycheck.php');
+
+		$cronTag = $sconfig->getString('cron_tag', NULL);
+		if ($cronTag === NULL || $cronTag !== $croninfo['tag']) {
+			return;
+		}
+
 		$info = array();
 		$errors = array();
 		$hookinfo = array(
diff --git a/modules/sanitycheck/www/index.php b/modules/sanitycheck/www/index.php
index 76eb731fe933957aa9666391eec3d2c1eef23654..d8b6088384f4825f3cb702ae8d154e5a01f86c09 100644
--- a/modules/sanitycheck/www/index.php
+++ b/modules/sanitycheck/www/index.php
@@ -2,7 +2,6 @@
 
 
 $config = SimpleSAML_Configuration::getInstance();
-$sconfig = SimpleSAML_Configuration::getConfig('config-sanitycheck.php');
 
 $info = array();
 $errors = array();