diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 8f03087e568f62646e2af042ff80f66905f91d20..f843c7027d5b9dfdd3d66830882a0f591f675841 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -231,8 +231,9 @@ class Hooks {
 			$util = new Util($view, $userId);
 			$path = $util->fileIdToPath($params['itemSource']);
 
+			$share = $util->getParentFromShare($params['id']);
 			//if parent is set, then this is a re-share action
-			if ($params['parent']) {
+			if ($share['parent'] != null) {
 
 				// get the parent from current share
 				$parent = $util->getShareParent($params['parent']);
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 6eee1ada8a873ee1e68138c25cbacf94f0c78ae1..91d86cc8558858844876fd77cad0cf7d96e1b4ef 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1133,19 +1133,7 @@ class Util {
 
             }
 
-            // Make path relative for use by $view
-            $relpath = \OC\Files\Filesystem::normalizePath($fileOwnerUid . '/' . $this->fileFolderName . '/' . $filename);
-
-            // Check that the filename we're using is working
-            if ( $this->view->file_exists( $relpath ) ) {
-
-                return array ( $fileOwnerUid, $filename );
-
-            } else {
-
-                return false;
-
-            }
+            return array ( $fileOwnerUid, $filename );
         }
 
 		
@@ -1230,6 +1218,25 @@ class Util {
 
 	}
 
+	/**
+	 * @brief get shares parent.
+	 * @param int $id of the current share
+	 * @return array of the parent
+	 */
+	public static function getParentFromShare( $id ) {
+
+		$query = \OC_DB::prepare( 'SELECT `parent`'
+			.' FROM `*PREFIX*share`'
+			.' WHERE `id` = ?' );
+
+		$result = $query->execute( array( $id ) );
+
+		$row = $result->fetchRow();
+
+		return $row;
+
+	}
+
 	/**
 	 * @brief get owner of the shared files.
 	 * @param int $Id of a share