moved block up and check if remote instead of if sessionID
only check for stats.failing
Merge branch 'master' into force-port-9000