added correct functionality for clicking on a region