diff --git a/mobile_tools_context/mobile_tools_context.module b/mobile_tools_context/mobile_tools_context.module
index ffc5fe6..98061d5 100644
--- a/mobile_tools_context/mobile_tools_context.module
+++ b/mobile_tools_context/mobile_tools_context.module
@@ -15,10 +15,13 @@ function mobile_tools_context_init() {
     if (module_exists('context')){
       $plugin = context_get_plugin('condition', 'device_group');
       if (!empty($plugin)) {
-        $device = mobile_tools_get_active_device_group();
-        // Init all active device groups
-        foreach($device as $key => $group) {
-          $plugin->execute($group['type']);
+      $device = mobile_tools_get_active_device_group();
+        // Returns active devices array, false otherwise
+        if (gettype($device) == 'array') {
+          // Init all active device groups
+          foreach($device as $key => $group) {
+            $plugin->execute($group['type']);
+          }
         }
       }
     }
