diff --git a/silkaj/tx_history.py b/silkaj/tx_history.py
index ea86cb4e9a81c9bb34ad672f920078debb6f3c60..c265e950b12dcc17ed8aa1deba6df3c0428d2cfa 100644
--- a/silkaj/tx_history.py
+++ b/silkaj/tx_history.py
@@ -253,10 +253,18 @@ def prefix(tx_addresses, outputs, occurence):
     """
     Pretty print with texttable
     Break line when several values in a cell
-    Handle Total line in case of multi-output txs
+
+    Received tx case, 'outputs' is not defined, then add a breakline
+    between the pubkeys except for the first occurence for multi-sig support
+
+    Sent tx case, handle "Total" line in case of multi-output txs
+    In case of multiple outputs, there is a "Total" on the top,
+    where there must be a breakline
     """
+
+    if not outputs:
+        return "\n" if occurence > 0 else ""
+
     if tx_addresses == "Total":
         return "\n"
-    if not outputs:
-        return ""
-    return "\n" if occurence + len(outputs) > 1 else ""
+    return "\n" if len(outputs) > 1 else ""
diff --git a/tests/test_tx_history.py b/tests/test_tx_history.py
index 60111fbc9ee9a591070620c2f34b7b3b6798dac8..edc2c03a5c560d84ab20cd2dc9d9a66a7491a9cf 100644
--- a/tests/test_tx_history.py
+++ b/tests/test_tx_history.py
@@ -17,11 +17,8 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
 
 import pytest
 from duniterpy.api.client import Client
-from silkaj.tx_history import (
-    get_transactions_history,
-    remove_duplicate_txs,
-    generate_table,
-)
+
+from silkaj import tx_history
 from silkaj.constants import G1_DEFAULT_ENDPOINT
 
 
@@ -35,13 +32,35 @@ async def test_tx_history_generate_table():
     pubkey = "78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8"
 
     received_txs, sent_txs = list(), list()
-    await get_transactions_history(client, pubkey, received_txs, sent_txs)
+    await tx_history.get_transactions_history(client, pubkey, received_txs, sent_txs)
 
-    remove_duplicate_txs(received_txs, sent_txs)
-    txs_list = await generate_table(
+    tx_history.remove_duplicate_txs(received_txs, sent_txs)
+    txs_list = await tx_history.generate_table(
         received_txs, sent_txs, pubkey, ud_value, currency, uids
     )
     await client.close()
 
     for tx_list in txs_list:
         assert len(tx_list) == table_columns
+
+
+@pytest.mark.parametrize(
+    "tx_addresses, outputs, occurence, return_value",
+    [
+        (None, None, 0, ""),
+        (None, None, 1, "\n"),
+        (None, ["output1"], 0, ""),
+        (None, ["output1"], 1, ""),
+        (None, ["output1", "output2"], 0, "\n"),
+        (None, ["output1", "output2"], 1, "\n"),
+        ("pubkey", None, 0, ""),
+        ("pubkey", None, 1, "\n"),
+        ("pubkey", ["output1"], 0, ""),
+        ("pubkey", ["output1"], 1, ""),
+        ("Total", ["output1", "output2"], 0, "\n"),
+        ("pubkey", ["output1", "output2"], 0, "\n"),
+        ("pubkey", ["output1", "output2"], 1, "\n"),
+    ],
+)
+def test_prefix(tx_addresses, outputs, occurence, return_value):
+    assert tx_history.prefix(tx_addresses, outputs, occurence) == return_value