diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs
index bac3c212b..a81ff8008 100644
--- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs
+++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs
@@ -164,16 +164,16 @@ namespace Flow.Launcher.Plugin.SharedCommands
///
/// Gets the previous level directory from a path string.
/// Checks that previous level directory exists and returns it
- /// as a path string, or empty string if doesnt exit
+ /// as a path string, or empty string if doesn't exit
///
public static string GetPreviousExistingDirectory(Func locationExists, string path)
{
var previousDirectoryPath = "";
- int index = path.LastIndexOf('\\');
+ var index = path.LastIndexOf('\\');
if (index > 0 && index < (path.Length - 1))
{
previousDirectoryPath = path.Substring(0, index + 1);
- if (!locationExists(path))
+ if (!locationExists(previousDirectoryPath))
{
return "";
}