diff --git a/cron.php b/cron.php
index fd46174f2bddd1d48ebff24aa4d5de38f9dc7cf3..2bcaaff9fd9e77318893f7e02465f3a8afde29a0 100644
--- a/cron.php
+++ b/cron.php
@@ -23,9 +23,9 @@
 $RUNTIME_NOSETUPFS = true;
 require_once('lib/base.php');
 
-$appmode = OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'web' );
+$appmode = OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'ajax' );
 if( OC::$CLI ){
-	if( $appmode == 'web' ){
+	if( $appmode != 'cron' ){
 		OC_Appconfig::setValue( 'core', 'backgroundjob_mode', 'cron' );
 	}
 
@@ -41,7 +41,7 @@ if( OC::$CLI ){
 	OC_BackgroundJob_Worker::doAllSteps();
 }
 else{
-	if( $appmode == 'web' ){
+	if( $appmode == 'cron' ){
 		OC_JSON::error( array( 'data' => array( 'message' => 'Backgroundjobs are using system cron!')));
 		exit();
 	}
diff --git a/lib/base.php b/lib/base.php
index c3887dec2f8f9e5b5ce7f5632d00a6c86956d857..090d05cdbae760dcbc7052c47248f25b31a794dc 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -227,11 +227,17 @@ class OC{
 		OC_Util::addScript( "jquery.infieldlabel.min" );
 		OC_Util::addScript( "jquery-tipsy" );
 		OC_Util::addScript( "oc-dialogs" );
+		OC_Util::addScript( "backgroundjobs" );
 		OC_Util::addScript( "js" );
 		OC_Util::addScript( "eventsource" );
 		OC_Util::addScript( "config" );
 		//OC_Util::addScript( "multiselect" );
 		OC_Util::addScript('search','result');
+
+		if( OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'ajax' ) == 'ajax' ){
+			OC_Util::addScript( 'backgroundjobs' );
+		}
+		
 		OC_Util::addStyle( "styles" );
 		OC_Util::addStyle( "multiselect" );
 		OC_Util::addStyle( "jquery-ui-1.8.16.custom" );