fixes for selection handling