added getter for caret_index