Changed the way headers are handled