fix caret position