diff --git a/backup/restorelib.php b/backup/restorelib.php
index <HASH>..<HASH> 100644
--- a/backup/restorelib.php
+++ b/backup/restorelib.php
@@ -5346,7 +5346,7 @@
      */
     function restore_userdata_selected($restore,$modname,$modid) {
         // check first for per instance array
-        if (!empty($restore->mods[$modname]->instances)) { // supports per instance
+        if (!empty($restore->mods[$modname]->granular)) { // supports per instance
             return array_key_exists($modid,$restore->mods[$modname]->instances) 
                 && !empty($restore->mods[$modname]->instances[$modid]->userinfo);
         }
merged fix for restore support of user data from backups pre granular backup