fix moveCursor bug