diff --git a/side_bar/block_side_bar.php b/side_bar/block_side_bar.php
index f8a7144..a8f0323 100644
--- a/side_bar/block_side_bar.php
+++ b/side_bar/block_side_bar.php
@@ -210,27 +210,8 @@ class block_side_bar extends block_list {
                                   'course', $this->instance->pageid);
 
             if (!empty($section)) {
-                if ($modules = get_records('course_modules', 'section', $section->id)) {
-                    $mods = array();
-                    foreach ($modules as $module) {
-                        if (!isset($mods[$module->module])) {
-                            $mods[$module->module] = get_field('modules', 'name', 'id', $module->module);
-                        }
-                        
-                        $mod_lib = $CFG->dirroot . '/mod/' . $mods[$module->module] . '/lib.php';
-                        
-                        if (file_exists($mod_lib)) {
-                            require_once($mod_lib);
-                            
-                            $delete_func = $mods[$module->module] . '_delete_instance';
-                            
-                            if (function_exists($delete_func)) {
-                                $delete_func($module->instance);
-                            }
-                        }
-                    }
-                }
-                
+                print_error('error:nonempty', 'block_side_bar', $CFG->wwwroot.'/course/view.php?id='.$this->instance->pageid);
+                return false;
             }
             
             delete_records('course_sections', 'id', $section->id);
diff --git a/side_bar/lang/en/block_side_bar.php b/side_bar/lang/en/block_side_bar.php
index 74b2fa9..d097769 100644
--- a/side_bar/lang/en/block_side_bar.php
+++ b/side_bar/lang/en/block_side_bar.php
@@ -2,6 +2,7 @@
 
 $string['configsectionnumber'] = 'Enter new section starting number';
 $string['configtitle'] = 'Enter new block title';
+$string['error:nonempty'] = 'All resources and activities must be removed before this block can be deleted';
 $string['sectionnumberwarning'] = 'WARNING: This value should be high enough that it will not ' .
                                   'interfere with regular course section values.  Also, if you ' .
                                   'already have blocks setup make sure you modify this value to ' .
diff --git a/side_bar/lang/en_utf8/block_side_bar.php b/side_bar/lang/en_utf8/block_side_bar.php
index e084b43..adda150 100644
--- a/side_bar/lang/en_utf8/block_side_bar.php
+++ b/side_bar/lang/en_utf8/block_side_bar.php
@@ -2,6 +2,7 @@
 
 $string['configsectionnumber'] = 'Enter new section starting number';
 $string['configtitle'] = 'Enter new block title';
+$string['error:nonempty'] = 'All resources and activities must be removed before this block can be deleted';
 $string['sectionnumberwarning'] = 'WARNING: This value should be high enough that it will not ' .
                                   'interfere with regular course section values.  Also, if you ' .
                                   'already have blocks setup make sure you modify this value to ' .
