diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java
index <HASH>..<HASH> 100755
--- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java
+++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java
@@ -251,7 +251,6 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O
 

     String serverUrl = null;

     do {

-      session.commandExecuting = true;

       OChannelBinaryAsynchClient network = null;

 

       if (serverUrl == null)

@@ -273,6 +272,8 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O
       } while (network == null);

 

       try {

+        session.commandExecuting = true;

+

         // In case i do not have a token or i'm switching between server i've to execute a open operation.

         OStorageRemoteNodeSession nodeSession = session.getServerSession(network.getServerURL());

         if (nodeSession == null || !nodeSession.isValid()) {
fixed cleaning of session state in case of network error, issue #<I>