diff --git a/core/src/main/java/com/orientechnologies/orient/core/intent/OIntentMassiveInsert.java b/core/src/main/java/com/orientechnologies/orient/core/intent/OIntentMassiveInsert.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/intent/OIntentMassiveInsert.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/intent/OIntentMassiveInsert.java
@@ -42,7 +42,7 @@ public class OIntentMassiveInsert implements OIntent {
     removedHooks = new HashMap<ORecordHook, ORecordHook.HOOK_POSITION>();

     HashMap<ORecordHook, ORecordHook.HOOK_POSITION> hooks = new HashMap<ORecordHook, ORecordHook.HOOK_POSITION>(ownerDb.getHooks());

     for (Map.Entry<ORecordHook, ORecordHook.HOOK_POSITION> hook : hooks.entrySet()) {

-      if (!(hook instanceof OClassIndexManager)) {

+      if (!(hook.getKey() instanceof OClassIndexManager)) {

         removedHooks.put(hook.getKey(), hook.getValue());

         ownerDb.unregisterHook(hook.getKey());

       }
massive insert removed all hooks, including OClassIndexManager,fixed