diff --git a/lib/base.php b/lib/base.php
index 7783b4c6380d8106a68d07f56dfd2e6e416076f6..d1422d7fc5e560502e40825e09d97624eff907ba 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -293,6 +293,11 @@ class OC{
 		if( !OC_Config::getValue( "installed", false )){
 			$_SESSION['user_id'] = '';
 		}
+		
+		// register the stream wrappers
+		require_once('streamwrappers.php');
+		stream_wrapper_register("fakedir", "OC_FakeDirStream");
+		stream_wrapper_register('static', 'OC_StaticStreamWrapper');
 
 		OC_User::useBackend( OC_Config::getValue( "userbackend", "database" ));
 		OC_Group::setBackend( OC_Config::getValue( "groupbackend", "database" ));
@@ -346,9 +351,5 @@ if(!function_exists('get_temp_dir')) {
 
 OC::init();
 
-require_once('streamwrappers.php');
-
-
-
 // FROM search.php
 new OC_Search_Provider_File();
diff --git a/lib/streamwrappers.php b/lib/streamwrappers.php
index 1454a99e8d5466a8c5acfc0b174f371a64296ffd..05d5598819a1488306b47f9935bef64edf473fa9 100644
--- a/lib/streamwrappers.php
+++ b/lib/streamwrappers.php
@@ -218,6 +218,3 @@ class OC_StaticStreamWrapper {
 		return false;
 	}
 }
-
-stream_wrapper_register("fakedir", "OC_FakeDirStream");
-stream_wrapper_register('static', 'OC_StaticStreamWrapper');