fix multiple selection and cleanup