Fixed setHeaders method