added selection and cursor (no error) handling