fix bug for seq2sparse