Fix #70
diff --git a/R/add_header_above.R b/R/add_header_above.R
index e716b69..62dd0e6 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -123,9 +123,9 @@
   new_header_split <- pdfTable_new_header_generator(header, table_info$booktabs,
                                                     bold, italic, monospace)
   new_header <- paste0(new_header_split[1], "\n", new_header_split[2])
-  out <- sub(hline_type,
-             paste0(hline_type, "\n", new_header),
-             enc2utf8(as.character(kable_input)))
+  out <- str_replace(enc2utf8(as.character(kable_input)),
+                     hline_type,
+                     paste0(hline_type, "\n", new_header))
   out <- structure(out, format = "latex", class = "knitr_kable")
   # new_header_row <- latex_contents_escape(new_header_split[1])
   if (is.null(table_info$new_header_row)) {