diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 6d47b3038c647ca6d821fb004d4bb62fcc3d144e..f99e26a0915dffb555aacfe5de62099512f857ab 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -164,8 +164,8 @@ class Storage {
 		
 		// if the file already exists than it was a upload of a existing file
 		// over the web interface -> store() is the right function we need here
-		if ($files_view->file_exists($new_path)) {
-			return self::store($newpath);
+		if ($files_view->file_exists($newpath)) {
+			return self::store($new_path);
 		}
 		
 		$abs_newpath = $versions_view->getLocalFile($newpath);