diff --git a/lib/gollum/frontend/public/javascript/gollum.js b/lib/gollum/frontend/public/javascript/gollum.js
index <HASH>..<HASH> 100644
--- a/lib/gollum/frontend/public/javascript/gollum.js
+++ b/lib/gollum/frontend/public/javascript/gollum.js
@@ -100,13 +100,13 @@ var nodeSelector = {
        }
        
      } else {
-       // not checked, get a range set up
-       $node.addClass('selected');
        if ( !nodeSelector.node1 ) {
          nodeSelector.node1 = $node;
+         nodeSelector.node1.addClass('selected');
        } else if ( !nodeSelector.node2 ) {
          // okay, we don't have a node 2 but have a node1
          nodeSelector.node2 = $node;
+         nodeSelector.node2.addClass('selected');
          nodeSelector.selectNodeRange( nodeSelector.node1, 
                                        nodeSelector.node2 );
        } else {
Fix nodeSelector bug where out-of-range node is selected