More refactoring
diff --git a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
index 52ddadf..fb8ba0d 100755
--- a/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
+++ b/asterix-examples/src/main/resources/black-cherry/static/js/cherry.js
@@ -180,13 +180,13 @@
     end_dp.val(dateOptions.defaultDate);
     
     // Explore Mode: Toggle Selection/Location Search
-    $('#selection-button').on('click', function (e) {
+    $('#selection-button').on('change', function (e) {
         $("#location-text-box").attr("disabled", "disabled");
         if (selectionRect) {
             selectionRect.setMap(map);
         }
     });
-    $('#location-button').on('click', function (e) {
+    $('#location-button').on('change', function (e) {
         $("#location-text-box").removeAttr("disabled");
         if (selectionRect) {
             selectionRect.setMap(null);
@@ -229,7 +229,9 @@
         var bounds;
         if ($('#selection-button').hasClass("active") && selectionRect) {
             bounds = selectionRect.getBounds();
+            alert("using rectangle");
         } else {
+            alert("Using map");
             bounds = map.getBounds();
         }
         
@@ -270,7 +272,6 @@
         // Clears selection rectangle on query execution, rather than waiting for another clear call.
         if (selectionRect) {
             selectionRect.setMap(null);
-            selectionRect = null;
         }
     });
 }
@@ -1081,7 +1082,6 @@
 
     if (selectionRect) {
         selectionRect.setMap(null);
-        selectionRect = null;
     }
     
     mapWidgetClearMap();
@@ -1183,4 +1183,4 @@
   var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
   var d = R * c;
   return d;
-};
\ No newline at end of file
+};