diff --git a/lib/core/notes_folder.dart b/lib/core/notes_folder.dart
index 7cfe578e..ab66f776 100644
--- a/lib/core/notes_folder.dart
+++ b/lib/core/notes_folder.dart
@@ -268,8 +268,8 @@ class NotesFolder with ChangeNotifier implements Comparable<NotesFolder> {
   void rename(String newName) {
     var dir = Directory(folderPath);
     var parentDirName = dirname(folderPath);
-    folderPath = p.join(parentDirName, newName);
     dir.renameSync(folderPath);
+    folderPath = p.join(parentDirName, newName);
 
     notifyListeners();
   }