     (setq line2 (elt reg 2))
     (setq col2  (elt  reg 3))
     (highlight-region line1 (- col1 1) line2  col2 buffer)
-    (if (equal (read-char-exclusive) '13)
-	(setq regions (cdr regions))
-      (setq regions nil))
-    )
+   ;; (message "Press 'Enter' key to go to the next instance, any other key to exit.")
+    (let ((input (read-event)))
+      (if (equal input 'return)
+	  (progn (setq regions (cdr regions))
+	         (message  " ")
+	   )
+	(if (equal input 'escape)
+	    (setq regions nil)
+	  (message "Press 'Enter' key to go to the next instance, any other key to exit.")
+	  )
+	)
+      ))
   (delete-overlay highlight-region-overlay)
   )
 

  (let ((current-file-name (buffer-file-name))
	(buffer (current-buffer)))	     
    (erl-spawn
      (erl-send-rpc node 'wrangler_distel 'duplicated_code
		    (list current-file-name minlines minclones))
      (erl-receive (buffer)
	  ((['rex ['badrpc rsn]]
	    (message "Duplicated code detection failed: %S" rsn))

  (let ((current-file-name (buffer-file-name))
	(buffer (current-buffer)))	     
    (erl-spawn
      (erl-send-rpc node 'wrangler_distel 'duplicated_code_in_buffer
		    (list current-file-name mintokens minclones))
      (erl-receive (buffer)
	  ((['rex ['badrpc rsn]]
	    (message "Duplicated code detection failed: %S" rsn))
