Fixed variable names in header method

Bug occurred when passing headers as an array.