add selection handling