diff --git a/web/pgadmin/static/js/tree/tree.js b/web/pgadmin/static/js/tree/tree.js
index f0388f7e..13775595 100644
--- a/web/pgadmin/static/js/tree/tree.js
+++ b/web/pgadmin/static/js/tree/tree.js
@@ -246,11 +246,14 @@ export class Tree {
   register($treeJQuery) {
     $treeJQuery.on('acitree', function (event, api, item, eventName) {
       if (api.isItem(item)) {
-        if (eventName === 'added') {
+        /* If the id of node is changed, the path should also be changed */
+        if (eventName === 'added' || eventName === 'idset') {
           const id = api.getId(item);
           const data = api.itemData(item);
 
-          this.prepareDraggable(data, item);
+          if(eventName === 'added') {
+            this.prepareDraggable(data, item);
+          }
 
           const parentId = this.translateTreeNodeIdFromACITree(api.parent(item));
           this.addNewNode(id, data, item, parentId);
