caret stays in the correct position