changed the way headers where sent