updating caret position to work properly