fixed cusor indexing position bug