refactoring. dragged caret was half added