diff --git a/smart_breadcrumb.inc b/smart_breadcrumb.inc
index 6951da6..a98c316 100644
--- a/smart_breadcrumb.inc
+++ b/smart_breadcrumb.inc
@@ -328,12 +328,11 @@ class Smart_breadcrumb {
 
   // set drupal breadcrumb and update cached data
   function set_breadcrumb() {
-    drupal_set_breadcrumb($this->breadcrumb);
-
     // update cache if not cached already
     if (!$this->cached) {
       $this->cache_update();
     }
+    return $this->breadcrumb;
   }
 
   // update cached data with new breadcrumb
diff --git a/smart_breadcrumb.module b/smart_breadcrumb.module
index 8c46aae..e0acc62 100644
--- a/smart_breadcrumb.module
+++ b/smart_breadcrumb.module
@@ -33,18 +33,15 @@ function smart_breadcrumb_menu() {
 /**
  * Initiates Smart Breadcrumb
  */
-function smart_breadcrumb_init() {
+function smart_breadcrumb_preprocess_page(&$vars) {
   global $smart_breadcrumb, $smart_breadcrumb_run;
 
   // include Smart_breadcrumb class from include file
-  require_once(drupal_get_path('module', 'smart_breadcrumb') . '/smart_breadcrumb.inc');
+  require(drupal_get_path('module', 'smart_breadcrumb') . '/smart_breadcrumb.inc');
 
-  // check if smart_breadcrumb has been run yet
-  if (!$smart_breadcrumb_run) {
-    $smart_breadcrumb = new Smart_breadcrumb();
-    $smart_breadcrumb->generate_breadcrumbs();
-    $smart_breadcrumb->set_breadcrumb();
+  $smart_breadcrumb = new Smart_breadcrumb();
+  $smart_breadcrumb->generate_breadcrumbs();
+  $smart_breadcrumb->set_breadcrumb();
 
-    $smart_breadcrumb_run = TRUE;
-  }
+  $vars['breadcrumb'] = theme('breadcrumb', $smart_breadcrumb->set_breadcrumb());
 }
