diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php
index 5cd9572d7f99eb3328cfb53edff52f6d98b9834a..a819578e3092fd221572a44222883b0a4e58aa1a 100644
--- a/apps/files/ajax/scan.php
+++ b/apps/files/ajax/scan.php
@@ -6,13 +6,14 @@ $force=isset($_GET['force']) and $_GET['force']=='true';
 $dir=isset($_GET['dir'])?$_GET['dir']:'';
 $checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';
 
+$eventSource=false;
 if(!$checkOnly) {
 	$eventSource=new OC_EventSource();
 }
 
 session_write_close();
 
-//create the file cache if necesary
+//create the file cache if necessary
 if($force or !OC_FileCache::inCache('')) {
 	if(!$checkOnly) {
 		OCP\DB::beginTransaction();