diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php
index e6ed47f..ad86851 100644
--- a/system/helpers/directory_helper.php
+++ b/system/helpers/directory_helper.php
@@ -40,12 +40,10 @@
  * @return	array
  */	
 function directory_map($source_dir, $top_level_only = FALSE)
-{
-	if ( ! isset($filedata))
-		$filedata = array();
-	
+{	
 	if ($fp = @opendir($source_dir))
 	{
+		$filedata = array();
 		while (FALSE !== ($file = readdir($fp)))
 		{
 			if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.' AND $top_level_only == FALSE)