caret position correction