diff --git role_theme_switcher.info role_theme_switcher.info
index 6d181f4..cb14104 100644
--- role_theme_switcher.info
+++ role_theme_switcher.info
@@ -2,8 +2,8 @@
 name = Role Theme Switcher
 description = "Assign separate themes to different roles"
 package = Theme
-core = 6.x
-version = "6.4"
+core = 7.x
+version = "7.4"
 project = "role_theme_switcher"
 datestamp = "1213747225"
 
diff --git role_theme_switcher.module role_theme_switcher.module
index 0ec060b..b9ab37a 100644
--- role_theme_switcher.module
+++ role_theme_switcher.module
@@ -2,24 +2,17 @@
 // $Id$
 
 /**
- * Implementation of hook_init().
+ * Implementation of hook_custom_theme().
  */
-function role_theme_switcher_init()
-{
-  global $user, $custom_theme;
-
+function role_theme_switcher_custom_theme(){
+  global $user;
+  $role_theme = NULL;
   foreach ($user->roles as $key => $value)
   {
     $role_name	= str_replace(' ', '_', $value);
     $role_theme	= variable_get(strtolower($role_name) .'_theme', '');
-
-    // Change active theme in user object
-    $user->theme = $role_theme;
-
-    // Also change the active theme globally
-    $custom_theme = $role_theme;
-    drupal_clear_css_cache();
   }
+  return array($role_theme);
 }
 
 /**
