add the selection of polygons
little refactor of events handling