diff --git a/includes/media_browser_plus.folders.inc b/includes/media_browser_plus.folders.inc
index 8696421..0feb8d5 100644
--- a/includes/media_browser_plus.folders.inc
+++ b/includes/media_browser_plus.folders.inc
@@ -83,7 +83,7 @@ function media_browser_plus_folder_list_submit($form, &$form_state) {
       $destination = media_browser_plus_construct_dir_path($folder);
       if ($source != $destination) {
         // Update physical folder structure.
-        media_browser_plus_move_physical_folder($source, $destination);
+        media_browser_plus_folder_update_set_batch($folder);
       }
     }
   }
@@ -421,25 +421,7 @@ function media_browser_plus_folder_save_folder($form_state) {
       // Update physical folder.
       $destination = media_browser_plus_construct_dir_path($term);
       if ($source != $destination) {
-        media_browser_plus_move_physical_folder($source, $destination);
-        // Update files in folder and subfolders get folders.
-        $folders = array($term->tid);
-        $sub_folders = taxonomy_get_children($term->tid);
-        // Add subfolders if found.
-        foreach ($sub_folders as $sf) {
-          $folders[] = $sf->tid;
-        }
-        $path = drupal_get_path('module', 'media_browser_plus');
-        // Set batch.
-        $batch = array(
-          'title' => t('Updating Media'),
-          'operations' => array(
-            array('media_browser_plus_folder_update_file_locations_batch', array($folders)),
-          ),
-          'finished' => 'media_browser_plus_folder_update_file_locations_batch_complete',
-          'file' => $path . '/includes/media_browser_plus.folders.inc',
-        );
-        batch_set($batch);
+        media_browser_plus_folder_update_set_batch($term);
       }
       drupal_set_message(t('Folder %term_name updated successfully', array('%term_name' => $term->name)));
       break;
@@ -495,6 +477,34 @@ function media_browser_plus_folder_theme_folder_weight_column($weight, $folder_i
   return $output;
 }
 
+/*
+ * Set batch to update media objects of folder and its children, when folder is moved.
+ *
+ * @param object $folder
+ * The term object of folder
+ */
+function media_browser_plus_folder_update_set_batch($folder) {
+    // update files in folder and subfolders
+    // get folders
+    $folders = array($folder->tid);
+    $sub_folders = taxonomy_get_children($folder->tid);
+    // add subfolders if found
+    foreach ($sub_folders as $sf) {
+      $folders[] = $sf->tid;
+    }
+    $path = drupal_get_path('module', 'media_browser_plus');
+    // set batch
+    $batch = array(
+      'title' => t('Updating Media'),
+      'operations' => array(
+        array('media_browser_plus_folder_update_file_locations_batch', array($folders)),
+      ),
+      'finished' => 'media_browser_plus_folder_update_file_locations_batch_complete',
+      'file' => $path . '/includes/media_browser_plus.folders.inc'
+    );
+    batch_set($batch);
+}
+
 /**
  * Batch function that updates all media URIs inside the given folders.
  *
@@ -537,8 +547,24 @@ function media_browser_plus_folder_update_file_locations_batch($folders, &$conte
   foreach ($media_query->results as $media) {
     if (isset($media->field_folder[LANGUAGE_NONE][0]['tid'])) {
       $path = media_browser_plus_construct_dir_path(taxonomy_term_load($media->field_folder[LANGUAGE_NONE][0]['tid']));
-      $media->uri = $path . '/' . array_pop(explode('/', $media->uri));
-      file_save($media);
+      
+      // if destination doesn't exist, create folder:
+      if (!is_dir(drupal_realpath($path))) {
+        drupal_mkdir($path, NULL, TRUE);
+      }
+      
+      // store previous path before media update:
+      $previous_path = drupal_dirname($media->uri);
+      
+      // move file
+      if (file_move($media, $path . '/' . array_pop(explode('/', $media->uri)))) {
+        drupal_set_message(t('Successfully moved @file to @path', array('@file' => $media->uri, '@path' => $path)));
+      }
+      
+      // if parent folder is empty, remove it
+      if (drupal_rmdir(drupal_realpath($previous_path))) {
+        drupal_set_message(t('Successfully removed folder @folder', array('@folder' => $previous_path)));
+      };
     }
   }
   // Increment start.
