fix issue: cursor position is not set