fix selection and deselection