diff --git a/R/add_header_above.R b/R/add_header_above.R
index 6beb5a0..9582577 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -11,7 +11,7 @@
 #' convenience, when `colspan` equals to 1, users can drop the ` = 1` part.
 #' As a result, `c(" ", "title" = 2)` is the same as `c(" " = 1, "title" = 2)`.
 #' Alternatively, a data frame with two columns can be provided: The first
-#' column should contain the header names (character vector) and the second 
+#' column should contain the header names (character vector) and the second
 #' column should contain the colspan (numeric vector). This input can be used
 #' if there are problems with unicode characters in the headers.
 #' @param bold A T/F value to control whether the text should be bolded.
@@ -69,6 +69,23 @@
             "for details.")
     return(kable_input)
   }
+  if (is.null(header)) return(kable_input)
+  if (is.data.frame(header)){
+    if(ncol(header) == 2 & is.character(header[[1]]) & is.numeric(header[[2]])){
+      header <- data.frame(header = header[[1]], colspan = header[[2]],
+                           stringsAsFactors = FALSE)
+    }
+    else {
+      stop("If header input is provided as a data frame instead of a named",
+           "vector it must consist of only two columns: ",
+           "The first should be a character vector with ",
+           "header names and the second should be a numeric vector with ",
+           "the number of columns the header should span.")
+    }
+  }
+  else {
+    header <- standardize_header_input(header)
+  }
   if (kable_format == "html") {
     return(htmlTable_add_header_above(
       kable_input, header, bold, italic, monospace, underline, strikeout,
@@ -90,29 +107,10 @@
                                        align, color, background, font_size,
                                        angle, escape, line, line_sep,
                                        extra_css, include_empty) {
-  if (is.null(header)) return(kable_input)
-   
   kable_attrs <- attributes(kable_input)
   kable_xml <- read_kable_as_xml(kable_input)
   kable_xml_thead <- xml_tpart(kable_xml, "thead")
-  
-  if (is.data.frame(header)){
-    if(ncol(header) == 2 & is.character(header[[1]]) & is.numeric(header[[2]])){
-      header <- data.frame(header = header[[1]], colspan = header[[2]],
-                           stringsAsFactors = FALSE)
-    }
-    else {
-      stop("If header input is provided as a data frame instead of a named vector ",
-           "it must consist of only two columns: ",
-           "The first should be a character vector with ",
-           "header names and the second should be a numeric vector with ",
-           "the number of columns the header should span.")
-    }
-  }
-  else {
-    header <- standardize_header_input(header)
-  }
-  
+
   if (escape) {
     header$header <- escape_html(header$header)
   }
@@ -236,7 +234,7 @@
                                       escape, line, line_sep,
                                       border_left, border_right) {
   table_info <- magic_mirror(kable_input)
-  
+
   if (is.data.frame(header)){
     if(ncol(header) == 2 & is.character(header[[1]]) & is.numeric(header[[2]])){
       header <- data.frame(header = header[[1]], colspan = header[[2]],
