diff --git a/lib/helper.php b/lib/helper.php
index 9faf8861161b944d038c1471940e3bf570ab3c15..072607f742ba3e6781e0798dd12d780f666fac8c 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -39,11 +39,10 @@ class OC_HELPER {
 		
 		if(!empty($app)) {
 			$app .= '/';
-		}
-		
-		// Check if the app is in the app folder
-		if( file_exists( $SERVERROOT . '/apps/'. $app )){
-			return $WEBROOT . '/apps/' . $app . $file;
+			// Check if the app is in the app folder
+			if( file_exists( $SERVERROOT . '/apps/'. $app )){
+				return $WEBROOT . '/apps/' . $app . $file;
+			}
 		}
 		return $WEBROOT . '/' . $app . $file;
 	}