fix a bug caused by CursorMoveToNext & change API