diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs
index af3fd8306..80f161c8a 100644
--- a/src/Text/Pandoc/Writers/Custom.hs
+++ b/src/Text/Pandoc/Writers/Custom.hs
@@ -51,5 +51,5 @@ writeCustom luaFile opts doc = either throw pure <=< runLua $ do
       -- options as arguments.
       push doc
       push opts
-      call 2 1
+      callTrace 2 1
       forcePeek $ peekText top