added a setHeaders function