diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 038ec78bbdbe83bd671f4a83bf40cfb8e598d219..7acb3ce2dc35435bfbe13a130e7353f0dd709610 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1406,7 +1406,7 @@ class Util {
 		foreach ($dirContent as $item) {
 			$filePath = substr($item['path'], 25);
 			if ($item['type'] == 'dir') {
-				$this->addRecoveryKey($filePath . '/', $privateKey);
+				$this->recoverAllFiles($filePath . '/', $privateKey);
 			} else {
 				$file = substr($filePath, 0, -4);
 				$this->recoverFile($file, $privateKey);